```
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int flag2=0;
int flag1=0;
ll func2(string s1,string s2,ll n)
{
int count=0;
ll i=0;
while(i<n-1)
{
if(s2[i+1]=='#' && s1[i+1]=='#')
{
if(flag1==0)
{
flag2=1;
cout<<"No"<<endl;
break;
}
}
else if(s2[i+1]=='#')
{
if(s1[i+1]=='.')
{
swap(s1,s2);
count++;
}
else if(s1[i]=='.')
{
swap(s1,s2);
count++;
}
i++;
}
else
{
i++;
}
}
return count;
}
ll func1(string s1,string s2,int n)
{
ll count=0;
ll i=0;
while(i<n-1)
{
if(s1[i+1]=='#' && s2[i+1]=='#')
{
if(flag2==0)
{
flag1=1;
cout<<"No"<<endl;
break;
}
}
else if(s1[i+1]=='#')
{
if(s2[i+1]=='.')
{
swap(s1,s2);
count++;
}
else if(s2[i]=='.')
{
swap(s1,s2);
count++;
}
i++;
}
else
{
i++;
}
}
return count;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll t;
cin>>t;
while(t-->0)
{
string s1,s2;
cin>>s1>>s2;
ll n=s1.length();
ll kk[n];
ll kk1[n];
int flag=0;
for(ll i=0;i<n;i++)
{
if(s1[i]=='#' && s2[i]=='#')
{
flag=1;
cout<<"No"<<endl;
}
}
if(flag==0)
{
if(s1[0]=='.' && s2[0]=='#')
{
int value=func1(s1,s2,n);
if(flag1==0)
{
cout<<"Yes"<<endl<<value<<endl;
}
}
else if(s2[0]=='.' && s1[0]=='#')
{
int value=func2(s1,s2,n);
if(flag2==0)
{
cout<<"Yes"<<endl<<value<<endl;
}
}
else
{
ll value=min(func1(s1,s2,n),func2(s1,s2,n));
if(flag1==0 && flag2==0)
{
cout<<"Yes"<<endl<<value<<endl;
}
}
}
}
return 0;
}
```

**The Problem is GRGUY problem****