#include <bits/stdc++.h>
using namespace std;
vector<vector<long long> > v(10001);
int vis1[5005] = {0};
int vis2[5005] = {0};
stack<int> st;
struct topper {
  long long l, r, second, p;
};
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  topper arr[4];
  long long i, j;
  for (i = 0; i < 4; i++) {
    cin >> arr[i].l >> arr[i].second >> arr[i].r >> arr[i].p;
  }
  for (i = 0; i < 4; i++) {
    if (arr[i].l == 1) {
      int k = i - 1;
      if (i - 1 < 0) k = 3;
      if (arr[k].p == 1 || arr[i].p == 1) {
        cout << "YES";
        return 0;
      }
    }
    if (arr[i].r == 1) {
      int k = (i + 1);
      if (k > 3) k = 0;
      if (arr[k].p == 1 || arr[i].p == 1) {
        cout << "YES";
        return 0;
      }
    }
    if (arr[i].second == 1) {
      int k = (i + 2) % 4;
      if (arr[k].p == 1 || arr[i].p == 1) {
        cout << "YES";
        return 0;
      }
    }
  }
  cout << "NO";
  return 0;
}
