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