#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 5;
long long n;
long long deg[N], ans[N];
vector<pair<long long, long long> > g[N];
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t = 1;
  while (t--) {
    long long x1, x2, y1, y2, z1, z2;
    cin >> x1 >> y1 >> z1;
    cin >> x2 >> y2 >> z2;
    bool x = x1 ^ x2;
    x = !x;
    bool y = y1 ^ y2;
    y = !y;
    bool z = z1 ^ z2;
    z = !z;
    if (x || y || z)
      cout << "YES"
           << "\n";
    else
      cout << "NO"
           << "\n";
  }
  return 0;
}
