#include <bits/stdc++.h>
using namespace std;
int l[4][3];
int main() {
  for (int i = 1; i <= 2; i++) {
    for (int j = 1; j <= 3; j++) {
      cin >> l[i][j];
    }
  }
  int cnt = 0;
  for (int i = 1; i <= 3; i++) {
    if (l[1][i] == l[2][i]) {
      cnt++;
    }
  }
  if (cnt >= 1)
    cout << "YES\n";
  else
    cout << "NO\n";
}
