Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- string x,a;
- cin>>x;
- int i,cnt=0;
- for(i=0;i<5;i++){
- cin>>a;
- if(a[0]==x[0] || a[1]==x[1])
- cnt++;
- }
- if(cnt==0)
- cout<<"NO"<<endl;
- else
- cout<<"YES"<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement