#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[2];
  int b[2];
  int c[2];
  cin >> a[0] >> b[0] >> c[0];
  cin >> a[1] >> b[1] >> c[1];
  if (a[0] == a[1] || b[0] == b[1] || c[0] == c[1]) {
    cout << "YES\n";
  } else {
    cout << "NO\n";
  }
}
