#include <bits/stdc++.h>
int main() {
  int x, y, z, a, b, c;
  scanf("%d %d %d", &x, &y, &z);
  scanf("%d %d %d", &a, &b, &c);
  if (x == a || y == b || z == c)
    printf("YES\n");
  else
    printf("NO\n");
}
