#include <bits/stdc++.h>
#define REP(i,n) for(int i=0; i<(int)(n); ++i)

using namespace std;
int dx[7] = {0, -1, 1, 0, -1, 1, 0};
int dy[7] = {1, 0, 1, 0, -1, 0, -1};
int bx[19] = {
    0, 1, 1, 0, -1, -1, 0,
    2, 2, 2, 1, 0, -1, -2, -2, -2, -1, 0, 1
};
int by[19] = {
    0, 1, 0, -1, -1, 0, 1,
    2, 1, 0, -1, -2, -2, -2, -1, 0, 1, 2, 2
};

int main(){
    string str;
    
    const int B = 2;
    REP(i, 19) bx[i] += B;
    REP(i, 19) by[i] += B;

    while(cin >> str && str != "#") {
        int map[256];
        REP(i, 256) map[i] = str[i] == '1';

        int grid[10][10];
        int ngrid[10][10];
        REP(i, 10) REP(j, 10) ngrid[i][j] = -1;
        bool ok = true;
        for(int s = 0; s < (1 << 19); s++) {
            REP(i, 19) {
                int y = by[i];
                int x = bx[i];
                grid[y][x] = (s >> i & 1);
            }

            for(int i = 6; i >= 0; i--) {
                int y = by[i];
                int x = bx[i];
                int t = 0;
                REP(r, 7) {
                    t = (t << 1) | grid[y + dy[r]][x + dx[r]];
                }
                ngrid[y][x] = map[t];
            }

            int x = bx[0], y = by[0];
            int t = 0;
            REP(r, 7) {
                t = (t << 1) | ngrid[y + dy[r]][x + dx[r]];
            }
            if(ngrid[y][x] != map[t]) {
                ok = false;
                break;
            }
        }
        
        cout << (ok ? "yes" : "no") << endl;
    }
    return 0;
}