#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int n = 3;
  long long int arr[n], brr[n];
  for (long long int i = 0; i < n; i++) cin >> arr[i];
  for (long long int i = 0; i < n; i++) cin >> brr[i];
  long long int count = 0;
  for (long long int i = 0; i < n; i++) {
    if (arr[i] == brr[i]) count++;
  }
  if (count == 2 || count == 1)
    cout << "YES";
  else
    cout << "NO";
}
