#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  set<int> m1, m2;
  int a, b, c, d, e, f;
  cin >> a >> b >> c >> d >> e >> f;
  if (abs(a - d) + abs(b - e) + abs(c - f) != 3)
    cout << "YES\n";
  else
    cout << "NO\n";
}
