#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
void speed() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long binary_exponentation(long long a, long long b) {
  long long ret = 1;
  while (b) {
    if (b & 1) ret = (ret * a) % mod;
    b >>= 1;
    a = (a * a) % mod;
  }
  return ret;
}
int32_t main() {
  speed();
  {
    long long a1, b1, c1, a2, b2, c2;
    cin >> a1 >> b1 >> c1 >> a2 >> b2 >> c2;
    if (a1 == a2 || b1 == b2 || c1 == c2)
      cout << "YES" << '\n';
    else
      cout << "NO" << '\n';
  }
  return 0;
}
