#include <bits/stdc++.h>
using namespace std;
inline int read() {
  char c = getchar();
  int f = 1, ret = 0;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c <= '9' && c >= '0') {
    ret = ret * 10 + c - '0';
    c = getchar();
  }
  return ret * f;
}
int main() {
  int mp[10][10];
  for (int i = 1; i <= 4; i++) {
    for (int j = 1; j <= 4; j++) {
      mp[i][j] = read();
    }
  }
  if (mp[1][4]) {
    if (mp[1][1] || mp[1][2] || mp[1][3] || mp[2][1] || mp[3][2] || mp[4][3]) {
      puts("YES");
      exit(0);
    }
  }
  if (mp[2][4]) {
    if (mp[2][1] || mp[2][2] || mp[2][3] || mp[1][3] || mp[3][1] || mp[4][2]) {
      puts("YES");
      exit(0);
    }
  }
  if (mp[3][4]) {
    if (mp[3][1] || mp[3][2] || mp[3][3] || mp[2][3] || mp[1][2] || mp[4][1]) {
      puts("YES");
      exit(0);
    }
  }
  if (mp[4][4]) {
    if (mp[4][1] || mp[4][2] || mp[4][3] || mp[1][1] || mp[2][2] || mp[3][3]) {
      puts("YES");
      exit(0);
    }
  }
  puts("NO");
  return 0;
}
