#include <bits/stdc++.h>
template <class T>
T abs(T a, T b) {
  return a > b ? a - b : b - a;
}
using namespace std;
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  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 && !flag; i++)
    if (((l[i] || r[i] || s[i]) && p[i]) || (l[i] && p[(i + 3) % 4]) ||
        (r[i] && p[(i + 1) % 4]) || (s[i] && p[(i + 2) % 4])) {
      flag = 1;
    }
  flag ? cout << "YES\n" : cout << "NO\n";
  return 0;
}
