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