#include <bits/stdc++.h>
using namespace std;
void fast() {
  std::ios_base::sync_with_stdio(NULL);
  cin.tie(NULL);
  cout.tie(NULL);
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
bool prim(int t) {
  if (t == 1)
    return false;
  else if (t == 2)
    return true;
  else if (t == 3)
    return true;
  else
    for (int i = 2; i * i <= t; i++) {
      if (t % i == 0) return false;
    }
  return true;
}
int dev(int t) {
  int c = 0;
  for (int i = 1; i * i <= t; i++) {
    if (t % i == 0) c += (i + (t / i));
    if (i * i == t) {
      c -= i;
    }
  }
  return c;
}
int gcd(long long x, long long y) {
  if (x > y) swap(x, y);
  if (y % x == 0) return x;
  bool f = 0;
  int g = -1;
  for (int i = 2; i * i <= x; i++) {
    if (x % i == 0 && y % i == 0) {
      g = i;
      f = 1;
    }
  }
  if (f) {
    return g;
  } else
    return 1;
}
int main() {
  fast();
  int l1, l2, l3, l4;
  int r1, r2, r3, r4;
  int s1, s2, s3, s4;
  int p1, p2, p3, p4;
  cin >> l1 >> s1 >> r1 >> p1;
  cin >> l2 >> s2 >> r2 >> p2;
  cin >> l3 >> s3 >> r3 >> p3;
  cin >> l4 >> s4 >> r4 >> p4;
  if (((l2 || r4 || s3 || l1 || s1 || r1) && p1) ||
      ((l3 || r1 || s4 || l2 || s2 || r2) && p2) ||
      ((l4 || r2 || s1 || l3 || s3 || r3) && p3) ||
      ((l1 || r3 || s2 || l4 || s4 || r4) && p4))
    cout << "YES"
         << "\n";
  else
    cout << "NO"
         << "\n";
  return 0;
}
