#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int ar[5][5];
  for (int i = 1; i <= 4; i++)
    for (int j = 1; j <= 4; j++) cin >> ar[i][j];
  int f = 0;
  if (ar[1][4] &&
      (ar[3][2] || ar[2][1] || ar[1][3] || ar[1][2] || ar[1][1] || ar[4][3]))
    f = 1;
  if (ar[2][4] &&
      (ar[2][1] || ar[2][3] || ar[2][2] || ar[4][2] || ar[3][1] || ar[1][3]))
    f = 1;
  if (ar[3][4] &&
      (ar[3][1] || ar[3][2] || ar[3][3] || ar[2][3] || ar[4][1] || ar[1][2]))
    f = 1;
  if (ar[4][4] &&
      (ar[4][1] || ar[4][2] || ar[4][3] | ar[1][1] || ar[3][3] || ar[2][2]))
    f = 1;
  if (f)
    cout << "YES" << '\n';
  else
    cout << "NO" << '\n';
  return 0;
}
