#include <bits/stdc++.h>
using namespace std;
int x11[50], x12[50], y11[50], y12[50];
int find_max(int a, int b, int c, int d, int n) {
  int maxmmmm = 0;
  for (int i = 0; i < n; i++) {
    int dis1 = 0, dis2 = 0;
    if (a == c) {
      if (x11[i] == x12[i]) {
        if ((y11[i] <= b && y11[i] >= d) || (y11[i] <= d && y11[i] >= b) ||
            (y12[i] <= b && y12[i] >= d) || (y12[i] <= d && y12[i] >= b)) {
          dis1 = abs(a - x11[i]);
          maxmmmm = max(maxmmmm, dis1);
        } else {
          dis1 = abs(a - x11[i]);
          dis2 = min(min(abs(b - y11[i]), abs(d - y11[i])),
                     min(abs(b - y12[i]), abs(d - y12[i])));
          maxmmmm = max(maxmmmm, dis1 + dis2);
        }
      } else {
        if ((y11[i] <= b && y11[i] >= d) || (y11[i] >= b && y11[i] <= d)) {
          if ((a <= x11[i] && a >= x12[i]) || (a >= x11[i] && a <= x12[i])) {
            dis1 = 0;
            maxmmmm = max(maxmmmm, dis1);
          } else {
            dis1 = min(abs(a - x11[i]), abs(a - x12[i]));
            maxmmmm = max(maxmmmm, dis1);
          }
        } else {
          if ((a <= x11[i] && a >= x12[i]) || (a >= x11[i] && a <= x12[i])) {
            dis1 = min(abs(b - y11[i]), abs(d - y12[i]));
            maxmmmm = max(maxmmmm, dis1);
          } else {
            dis1 = min(abs(a - x11[i]), abs(a - x12[i]));
            dis2 = min(abs(d - y11[i]), abs(d - y11[i]));
            maxmmmm = max(maxmmmm, dis1 + dis2);
          }
        }
      }
    } else {
      if (y11[i] == y12[i]) {
        if ((x11[i] <= a && x11[i] >= c) || (x11[i] <= a && x11[i] >= c) ||
            (x12[i] <= a && x12[i] >= c) || (x12[i] <= a && x12[i] >= c)) {
          dis1 = abs(b - y11[i]);
          maxmmmm = max(maxmmmm, dis1);
        } else {
          dis1 = abs(b - y11[i]);
          dis2 = min(min(abs(a - x11[i]), abs(c - x11[i])),
                     min(abs(a - x12[i]), abs(c - x12[i])));
          maxmmmm = max(maxmmmm, dis1 + dis2);
        }
      } else {
        if ((x11[i] <= a && x11[i] >= c) || (x11[i] >= a && x11[i] <= c)) {
          if ((b <= y11[i] && b >= y12[i]) || (b >= y11[i] && b <= y12[i])) {
            dis1 = 0;
            maxmmmm = max(maxmmmm, dis1);
          } else {
            dis1 = min(abs(b - y11[i]), abs(b - y12[i]));
            maxmmmm = max(maxmmmm, dis1);
          }
        } else {
          if ((b <= y11[i] && b >= y12[i]) || (b >= y11[i] && b <= y12[i])) {
            dis1 = min(abs(a - x11[i]), abs(c - x12[i]));
            maxmmmm = max(maxmmmm, dis1);
          } else {
            dis1 = min(abs(b - y11[i]), abs(b - y12[i]));
            dis2 = min(abs(a - x11[i]), abs(c - x11[i]));
            maxmmmm = max(maxmmmm, dis1 + dis2);
          }
        }
      }
    }
  }
  return maxmmmm;
}
int find_all_max(int p, int q, int n) {
  int minm_line = 1e9, line_index = 0;
  for (int i = 0; i < n; i++) {
    if (x11[i] == x12[i]) {
      if (abs(p - x11[i]) < minm_line) {
        minm_line = abs(p - x11[i]);
        line_index = i;
      }
    } else {
      if (abs(q - y11[i]) < minm_line) {
        minm_line = abs(q - y11[i]);
        line_index = i;
      }
    }
  }
  int a = x11[line_index], b = y11[line_index], c = x12[line_index],
      d = y12[line_index];
  int max_dist = find_max(a, b, c, d, n);
  return max_dist;
}
int main() {
  int l[4], r[4], s[4], p[4], flag = 0;
  for (int i = 0; i < 4; i++) {
    cin >> l[i] >> s[i] >> r[i] >> p[i];
  }
  for (int i = 0; i < 4; i++) {
    if (l[i] == 1) {
      if (p[i] == 1 || p[(i + 3) % 4] == 1) {
        flag = 1;
        break;
      }
    }
    if (s[i] == 1) {
      if (p[i] == 1 || p[(i + 2) % 4] == 1) {
        flag = 1;
        break;
      }
    }
    if (r[i] == 1) {
      if (p[i] == 1 || p[(i + 1) % 4] == 1) {
        flag = 1;
        break;
      }
    }
  }
  if (flag == 1) {
    cout << "YES";
  } else
    cout << "NO";
  return 0;
}
