#include <bits/stdc++.h>
using namespace std;
int sol;
int main() {
  int a, b, c;
  int x, y, z;
  scanf("%d %d %d", &a, &b, &c);
  scanf("%d %d %d", &x, &y, &z);
  sol = (a != x) + (b != y) + (c != z);
  puts(sol < 3 ? "YES" : "NO");
  return 0;
}
