#include <bits/stdc++.h>
using namespace std;
int i, l[10], s[10], r[10], p[10];
int main() {
  for (i = 1; i <= 4; ++i) cin >> l[i] >> s[i] >> r[i] >> p[i];
  if (p[1] == 1) {
    if (l[1] + s[1] + r[1] + r[4] + s[3] + l[2] > 0) {
      cout << "Yes";
      return 0;
    }
  }
  if (p[2] == 1) {
    if (l[2] + s[2] + r[2] + r[1] + s[4] + l[3] > 0) {
      cout << "Yes";
      return 0;
    }
  }
  if (p[3] == 1) {
    if (l[3] + s[3] + r[3] + r[2] + s[1] + l[4] > 0) {
      cout << "Yes";
      return 0;
    }
  }
  if (p[4] == 1) {
    if (l[4] + s[4] + r[4] + r[3] + s[2] + l[1] > 0) {
      cout << "Yes";
      return 0;
    }
  }
  cout << "No\n";
  return 0;
}
