#include <bits/stdc++.h>
using namespace std;
int main() {
  int x1, y1, z1, x2, y2, z2, dif;
  cin >> x1 >> y1 >> z1 >> x2 >> y2 >> z2;
  dif = abs(x2 - x1) + abs(y2 - y1) + abs(z2 - z1);
  if (dif < 3)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
