#include <bits/stdc++.h>
using namespace std;
int main() {
  int coord1_x, coord1_y, coord1_z, coord2_x, coord2_y, coord2_z;
  cin >> coord1_x >> coord1_y >> coord1_z;
  cin >> coord2_x >> coord2_y >> coord2_z;
  if (coord1_x != coord2_x && coord1_y != coord2_y && coord1_z != coord2_z) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
  }
  return 0;
}
