#include <bits/stdc++.h>
using namespace std;
int main() {
  int x[3], y[3];
  for (int i = 0; i < 3; i++) scanf("%d", &x[i]);
  for (int i = 0; i < 3; i++) scanf("%d", &y[i]);
  bool first = false;
  for (int i = 0; i < 3; i++)
    if (x[i] == y[i]) first = true;
  puts(first ? "YES" : "NO");
}
