#include <bits/stdc++.h>
using namespace std;
const int maxn = 4;
int l[maxn], s[maxn], r[maxn], p[maxn];
int main() {
  for (int i = 0; i < 4; i++) cin >> l[i] >> s[i] >> r[i] >> p[i];
  bool ck = true;
  for (int i = 0; i < 4; i++)
    if (p[i]) {
      if (l[i]) ck = false;
      if (s[i]) ck = false;
      if (r[i]) ck = false;
      if (l[(i + 1) % 4]) ck = false;
      if (s[(i + 2) % 4]) ck = false;
      if (r[(i + 3) % 4]) ck = false;
    }
  if (!ck)
    puts("YES");
  else
    puts("NO");
  return 0;
}
