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