#include <iostream>
using namespace std;
#define int long long
signed main(){
    char c[10][10];
    int fr = 0;
    int sc = 0;
    int th = 0;
    int fo = 0;
    for (int i = 0; i < 10; i++) {
        for (int j = 0; j < 10; j++) {
            cin >> c[i][j];

        }
    }
    if (fr == 4 && sc == 3 && th == 2 && fo == 1) {
        cout << "YES";
    }
}
