#include <bits/stdc++.h>
using namespace std;
int main() {
  int r[5], s[5], l[5], p[5];
  for (int i = 1; i < 5; i++) cin >> l[i] >> s[i] >> r[i] >> p[i];
  if ((p[1] == 1 && (l[2] == 1 || s[3] == 1 || r[4] == 1 || l[1] == 1 ||
                     s[1] == 1 || r[1] == 1)) ||
      (p[2] == 1 && (l[3] == 1 || s[4] == 1 || r[1] == 1 || l[2] == 1 ||
                     s[2] == 1 || r[2] == 1)) ||
      (p[3] == 1 && (l[4] == 1 || s[1] == 1 || r[2] == 1 || l[3] == 1 ||
                     s[3] == 1 || r[3] == 1)) ||
      (p[4] == 1 && (l[1] == 1 || s[2] == 1 || r[3] == 1 || l[4] == 1 ||
                     s[4] == 1 || r[4] == 1))) {
    puts("YES");
  } else {
    puts("NO");
  }
  return 0;
}
