import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop;


bool solve() {
    auto L = new int[](4);
    auto S = new int[](4);
    auto R = new int[](4);
    auto P = new int[](4);

    foreach (i; 0..4) {
        auto s = readln.split.map!(to!int);
        L[i] = s[0];
        S[i] = s[1];
        R[i] = s[2];
        P[i] = s[3];
    }

    foreach (i; 0..4) {
        if (L[i] && P[i]) return true;
        if (S[i] && P[i]) return true;
        if (R[i] && P[i]) return true;
    }

    foreach (i; 0..4) {
        if (L[i] && P[(i+3)%4]) return true;
    }

    foreach (i; 0..4) {
        if (S[i] && P[(i+2)%4]) return true;
    }

    foreach (i; 0..4) {
        if (R[i] && P[(i+1)%4]) return true;
    }

    return false;
}

void main() {
    writeln( solve ? "YES" : "NO" );
}
