#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<vector<int>> p;
  int a, b, c;
  cin >> a >> b >> c;
  p.push_back({a, b, c});
  cin >> a >> b >> c;
  p.push_back({a, b, c});
  if (p[0][0] != p[1][0] && p[0][1] != p[1][1] && p[0][2] != p[1][2]) {
    cout << "NO";
  } else
    cout << "YES";
  return 0;
}
