#include <bits/stdc++.h>
int main() {
  int a, b, dop;
  a = 0;
  b = 0;
  int m[3];
  bool f = false;
  for (int i = 0; i < 3; i++) scanf("%d", &m[i]);
  for (int i = 0; i < 3; i++) {
    scanf("%d", &dop);
    if (dop == m[i]) f = true;
  }
  if (!f)
    printf("NO");
  else
    printf("YES");
  return 0;
}
