#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int64_t x1, x2, x3, y1, y2, y3;
  cin >> x1 >> x2 >> x3;
  cin >> y1 >> y2 >> y3;
  if (x1 != y1 && x2 != y2 && x3 != y3)
    cout << "NO";
  else
    cout << "YES";
}
