#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, x, y, z;
  cin >> a >> b >> c >> x >> y >> z;
  if (a + b + c == 0 && x + y + z == 3 || x + y + z == 0 && a + b + c == 3) {
    cout << "NO";
    return 0;
  } else if (a + x == 1 && b + y == 1 && z + c == 1) {
    cout << "NO";
    return 0;
  } else
    cout << "YES";
  return 0;
}
