#include <bits/stdc++.h>
using namespace std;
int main() {
  int C[4][4];
  for (long long i = 0; i < 4; i++) {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    C[i][0] = a;
    C[i][1] = b;
    C[i][2] = c;
    C[i][3] = d;
  }
  bool pso = false;
  for (long long i = 0; i < 4; i++) {
    int sum = 0;
    if (C[i][3] == 1) {
      int kov;
      sum += C[i][0] + C[i][1] + C[i][2];
      kov = (i + 1) % 4;
      sum += C[kov][0];
      kov = (i + 2) % 4;
      sum += C[kov][1];
      kov = (i + 3) % 4;
      sum += C[kov][2];
    }
    if (sum) {
      pso = true;
    }
  }
  if (pso) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  cout << endl;
  return 0;
}
