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