#include <bits/stdc++.h>
using namespace std;
const double EPS = (double)1e-9;
const double PI = (double)acos(-1.0);
int irand(int lo, int hi) {
  return (((double)rand()) / (RAND_MAX + 1.0)) * (hi - lo + 1) + lo;
}
string toString(long long x) {
  stringstream ss;
  ss << x;
  return ss.str();
}
long long toNumber(string S) {
  long long ret;
  sscanf(S.c_str(), "%lld", &ret);
  return ret;
}
const int INF = (int)2e9;
const long long MOD = (long long)1e9 + 7;
int main() {
  int dat[5][5];
  for (int i = 0; i < 4; i++)
    for (int j = 1; j <= 4; j += 1) scanf("%d", &dat[i][j]);
  int flag = 0, ret = 0;
  for (int i = 0; i < 4; i++) {
    ret = dat[i][1] + dat[i][2] + dat[i][3];
    for (int j = 1; j <= 3; j += 1) ret += dat[(i + j) % 4][j];
    flag |= (ret > 0 && dat[i][4]);
  }
  puts(flag ? "YES" : "NO");
  return 0;
}
