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