#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, A, B, C;
  cin >> a >> b >> c >> A >> B >> C;
  if (a == A || b == B || c == C) {
    cout << "YES\n";
  } else
    cout << "NO\n";
  return 0;
}
