#include <bits/stdc++.h>
using namespace std;
int main() {
  int k = 0;
  char x1, x2, x[10];
  cin >> x1 >> x2;
  for (int i = 0; i < 10; i++) {
    cin >> x[i];
    if (x[i] == x1 || x[i] == x2) {
      k = 1;
    }
  }
  if (k)
    cout << "yes";
  else
    cout << "no";
}
