#include <bits/stdc++.h>
using namespace std;
bool l[5], s[5], r[5], p[5];
int main() {
  for (int i = 0; i < 4; i++) {
    cin >> l[i] >> s[i] >> r[i] >> p[i];
  }
  if ((l[0] && (p[0] || p[3])) || (s[0] && (p[0] || p[2])) ||
      (r[0] && (p[0] || p[1]))) {
    cout << "YES";
    return 0;
  }
  if ((l[1] && (p[0] || p[1])) || (s[1] && (p[1] || p[3])) ||
      (r[1] && (p[1] || p[2]))) {
    cout << "YES";
    return 0;
  }
  if ((l[2] && (p[2] || p[1])) || (s[2] && (p[2] || p[0])) ||
      (r[2] && (p[2] || p[3]))) {
    cout << "YES";
    return 0;
  }
  if ((l[3] && (p[3] || p[2])) || (s[3] && (p[3] || p[1])) ||
      (r[3] && (p[0] || p[3]))) {
    cout << "YES";
    return 0;
  }
  cout << "NO";
  return 0;
}
