#include <bits/stdc++.h>
using namespace std;
int check(long long int b) {
  while (b) {
    if (b % 10 != 9) return 0;
    b /= 10;
  }
  return 1;
}
int main() {
  int x, y, z;
  cin >> x >> y >> z;
  int a, b, c;
  cin >> a >> b >> c;
  int flag = 0;
  if (x == a)
    flag = 1;
  else if (y == b)
    flag = 1;
  else if (z == c)
    flag = 1;
  else
    flag = 0;
  if (flag)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
