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