#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> fly1;
  vector<int> fly2;
  vector<vector<int>> verticesOfFaces();
  for (int i = 0; i < 3; i++) {
    int a;
    cin >> a;
    fly1.push_back(a);
  }
  for (int i = 0; i < 3; i++) {
    int a;
    cin >> a;
    fly2.push_back(a);
  }
  bool common = false;
  for (int i = 0; i < 3; i++) {
    if (fly1[i] == fly2[i]) common = true;
  }
  if (common)
    cout << "YES";
  else
    cout << "NO";
}
