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