#include <bits/stdc++.h>
using namespace std;
int a[5][5], cnt;
int main() {
  for (int i = 1; i <= 2; i++)
    for (int j = 1; j <= 3; j++) scanf("%d", &a[i][j]);
  for (int i = 1; i <= 3 && cnt < 1; i++)
    if (!(a[1][i] ^ a[2][i])) cnt++;
  if (cnt >= 1)
    printf("YES");
  else
    printf("NO");
  return 0;
}
