#include <bits/stdc++.h>
using namespace std;
vector<long long> adj[100005];
bool visited[100005];
int main() {
  ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  int a[3], b[3];
  for (int i = 0; i < 3; i++) cin >> a[i];
  long long h = 0;
  for (int i = 0; i < 3; i++) {
    cin >> b[i];
    if (a[i] != b[i]) h++;
  }
  if (h == 3) return cout << "NO", 0;
  cout << "YES";
  return 0;
}
