#include <bits/stdc++.h>
using namespace std;
void in(int &n) {
  n = 0;
  int f = 1;
  char c = getchar();
  while (c < '0' || '9' < c) {
    if (c == '-') f *= -1;
    c = getchar();
  }
  while ('0' <= c && c <= '9') {
    n = n * 10 + (c - '0');
    c = getchar();
  }
  n *= f;
}
int a[5], b[5];
int main() {
  for (int i = 0; i < 3; i++) in(a[i]);
  for (int i = 0; i < 3; i++) in(b[i]);
  for (int i = 0; i < 3; i++)
    if (a[i] == b[i]) {
      printf("YES");
      return 0;
    }
  printf("NO");
  return 0;
}
