#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const int64_t INF = 1e18;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie();
  long long l[4], s[4], r[4], p[4];
  for (long long i = 0; i < 4; i++) cin >> l[i] >> s[i] >> r[i] >> p[i];
  for (long long i = 0; i < 4; i++)
    if (p[i]) {
      long long a = l[i] + s[i] + r[i];
      long long b = l[(i + 1) % 4] + s[(i + 2) % 4] + r[(i + 3) % 4];
      if (a || b) {
        cout << "YES";
        return 0;
      }
    }
  cout << "NO";
  return 0;
}
