#include <bits/stdc++.h>
using namespace std;
int main(int argc, char **argv) {
  int a, b, c, x, y, z;
  cin >> a >> b >> c >> x >> y >> z;
  bool f = ((a == x) || (b == y) || (c == z));
  if (f)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
