#include
#include
using namespace std;
int main
()
{
string s1,s2;
int p,c=0;
cin>>p;
for( ;p>0;p–)
{
getline(cin,s1);
getline(cin,s2);
for(int i=0;i<s1.length();i++)
{
for(int j=0;j<s2.length();j++)
{
if(s1[i]==s2[j])
{
c++;
}
}
}
if(c>0)
{
cout<<“yes”<<endl;
}
else
{
cout<<“no”<<endl;
}
}
return 0;
}