#include using namespace std; #define int long long vector> A(8,vector(8)); vector now(8); bool ans = false; void rotate(){ vector nex(8); for(int i = 0; i < 8; i++){ nex[i] = now[(i+1)%8]; } now = nex; } void dfs(int depth){ if(depth == 8){ int cnt = 0; for(int i = 0; i < 8; i++) cnt += (now[i]!=0); if(cnt == 0) ans = true; return; } vector mae = now; for(int i = 0; i <= 8; i++){ for(int j = 0; j < 8; j++) now[j] -= A[depth][j]; dfs(depth+1); for(int j = 0; j < 8; j++) now[j] += A[depth][j]; rotate(); } now = mae; } signed main(){ for(int i = 0; i < 8; i++){ string S;cin>>S; for(int j = 0; j < 8; j++){ A[i][j] = S[j] - '0'; } } now = A[0]; dfs(1); ans ? cout << "Yes" << "\n" : cout << "No" << "\n"; }