#include <bits/stdc++.h>
using namespace std;
long long __solve() {
  long long n, i, sum = 0, c2, cnt = 0, m, j, a, b, k, p, d, c;
  long long cnt1 = 0, ad, count = 0;
  bool flag = 1;
  string str, s;
  long long r = 0, u = 0, l;
  long long x, y;
  cin >> str;
}
long long fact(long long x) {
  if (x == 0 or x == 1)
    return 1;
  else
    return fact(x - 1) * x;
}
long long modinverse(long long a, long long m) {
  for (int x = 1; x < m; x++)
    if (((a % m) * (x % m)) % m == 1) return x;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  bool ok = 1, ck = 1;
  long long n, i, sum = 0, c2, cnt = 0, m, j, a, b, k = 0, p, d, c;
  string s1, s2, s3, s4, str;
  long long tmp = 0;
  int ans = 0;
  char ch;
  int t;
  long long x, y, z;
  cin >> a >> b >> c >> x >> y >> z;
  if (a == x or b == y or c == z)
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
