#include <bits/stdc++.h>
using namespace std;
int l[5], s[5], r[5], p[5];
int main() {
  for (int i = 1; i <= 4; ++i) {
    scanf("%d%d%d%d", &l[i], &s[i], &r[i], &p[i]);
  }
  int flag = 0;
  for (int i = 1; i <= 4; ++i) {
    if (p[i] == 1 && (l[i] == 1 || s[i] == 1 || r[i] == 1)) flag = 1;
  }
  if (p[1] == 1 && (l[2] == 1 || s[3] == 1 || r[4] == 1)) flag = 1;
  if (p[2] == 1 && (r[1] == 1 || l[3] == 1 || s[4] == 1)) flag = 1;
  if (p[3] == 1 && (r[2] == 1 || l[4] == 1 || s[1] == 1)) flag = 1;
  if (p[4] == 1 && (l[1] == 1 || s[2] == 1 || r[3] == 1)) flag = 1;
  if (flag)
    printf("YES\n");
  else
    printf("NO\n");
}
