#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[3], b[3], cnt = 0;
  cin >> a[0] >> a[1] >> a[2] >> b[0] >> b[1] >> b[2];
  for (int i = 0; i < 3; ++i)
    if (a[i] == b[i]) return cout << "YES" << endl, 0;
  return cout << "NO" << endl, 0;
}
