#include <bits/stdc++.h>
#pragma GCC optimize("02")
using namespace std;
int main() {
  int a, b, c;
  int x, y, z;
  cin >> a >> b >> c;
  cin >> x >> y >> z;
  if ((a ^ x) && (b ^ y) && (c ^ z))
    cout << "NO"
         << "\n";
  else
    cout << "YES"
         << "\n";
}
