#include <bits/stdc++.h>
using namespace std;
int reverse_int(int n) { return (n / 10 + n % 10 * 10); }
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long x, y, z, xx, yy, zz;
  cin >> x >> y >> z >> xx >> yy >> zz;
  if (x == xx || y == yy || zz == z)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
