#include <bits/stdc++.h>
using namespace std;
void solve() {
  int a0, a1, a2, b0, b1, b2;
  cin >> a0 >> a1 >> a2;
  cin >> b0 >> b1 >> b2;
  int diff = abs(a0 - b0) + abs(a1 - b1) + abs(a2 - b2);
  if (diff == 3)
    cout << "NO";
  else
    cout << "YES";
}
int main() {
  solve();
  return 0;
}
