#include <bits/stdc++.h>
using namespace std;
int main() {
  int x1, x2, x3, y1, y2, y3;
  cin >> x1 >> x2 >> x3 >> y1 >> y2 >> y3;
  int k = abs(y1 - x1) + abs(y2 - x2) + abs(y3 - x3);
  if (k == 3 || k == -3)
    puts("NO");
  else
    puts("YES");
  return 0;
}
