#include <bits/stdc++.h>
using namespace std;
int main() {
  int a1, a2, a3, b1, b2, b3;
  cin >> a1 >> a2 >> a3 >> b1 >> b2 >> b3;
  if (a1 == b1) {
    cout << "YES";
    return 0;
  }
  if (a2 == b2) {
    cout << "YES";
    return 0;
  }
  if (a3 == b3) {
    cout << "YES";
    return 0;
  }
  cout << "NO";
  return 0;
}
