#include <bits/stdc++.h>
using namespace std;
long long int mod = 1e9 + 7;
long long int p = 31;
long long int add(long long int a, long long int b) {
  return ((a % mod) + (b % mod)) % mod;
}
long long int mul(long long int a, long long int b) {
  return ((a % mod) * (b % mod)) % mod;
}
long long int powm(long long int x, long long int n, long long int M) {
  long long int result = 1;
  while (n > 0) {
    if (n % 2 == 1) result = (result * x) % M;
    x = (x * x) % M;
    n = n / 2;
  }
  return result;
}
vector<long long int> z1(string s) {
  long long int n = s.size();
  vector<long long int> z(n, 0);
  for (long long int i = 1, l = 0, r = 0; i < n; i++) {
    if (i <= r) {
      z[i] += min(r - i + 1, z[i - l]);
    }
    while (i + z[i] - 1 < n and (s[z[i]] == s[i + z[i]])) ++z[i];
    if (i + z[i] - 1 > r) {
      l = i;
      r = i + z[i] - 1;
    }
  }
  return z;
}
vector<string> v;
long long int solve(long long int x1, long long int y1, long long int z1,
                    long long int x2, long long int y2, long long int z2) {
  long long int x = pow(abs(x1 - x2), 2);
  long long int y = pow(abs(y1 - y2), 2);
  long long int z = pow(abs(z1 - z2), 2);
  return x + y + z;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int x1, y1, z1, x2, y2, z2;
  cin >> x1 >> y1 >> z1 >> x2 >> y2 >> z2;
  if (solve(x1, y1, z1, x2, y2, z2) <= 2)
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
