#include <bits/stdc++.h>
using namespace std;
int TN = 1;
int sled(int x) {
  if (x == 4) return 1;
  return x + 1;
}
int pred(int x) {
  if (x == 1) return 4;
  return x - 1;
}
int prot(int x) {
  if (x < 3)
    return x + 2;
  else
    return x - 2;
}
void solve() {
  int i, l[5], s[5], r[5], p[5];
  for (i = 1; i < 5; i++) cin >> l[i] >> s[i] >> r[i] >> p[i];
  for (i = 1; i < 5; i++) {
    if (l[i] && (p[i] || p[pred(i)])) {
      cout << "YES";
      return;
    }
    if (s[i] && (p[i] || p[prot(i)])) {
      cout << "YES";
      return;
    }
    if (r[i] && (p[i] || p[sled(i)])) {
      cout << "YES";
      return;
    }
  }
  cout << "NO";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  while (TN--) solve();
  return 0;
}
