#include <bits/stdc++.h>
int main() {
  int a, b, c, x, y, z, m[3];
  int j = 0;
  scanf("%d %d %d", &a, &b, &c);
  scanf("%d %d %d", &x, &y, &z);
  m[0] = a - x;
  m[1] = b - y;
  m[2] = c - z;
  for (int i = 0; i < 3; i++)
    if (m[i] == 0) j++;
  if (j >= 1)
    printf("YES");
  else
    printf("NO");
  scanf("%d", &a);
  return 0;
}
