#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, y, z;
  int a, b, c;
  cin >> x >> y >> z;
  cin >> a >> b >> c;
  if ((pow(abs(x - a), 2) + pow(abs(y - b), 2) + pow(abs(z - c), 2)) == (3)) {
    cout << "NO";
  } else {
    cout << "YES";
  }
}
