#include <iostream>
#include <cstdio>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <cstring>
#include <functional>
#include <cmath>
#include <complex>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);++i)
#define rep1(i,n) for(int i=1;i<=(n);++i)
#define all(c) (c).begin(),(c).end()
#define fs first
#define sc second
#define pb push_back
#define show(x) cout << #x << " " << x << endl
int magic[7][7]={
	{18,17,16,14,12,11,9},
	{17,15,14,12,10,9,7},
	{16,14,13,11,9,8,6},
	{14,12,11,9,7,6,4},
	{12,10,9,7,5,4,2},
	{11,9,8,6,4,3,1},
	{9,7,6,4,2,1,0}
};
bool solve(string s){
	rep(i,1<<19){
		int a[19];
		rep(j,19) a[j]=(i>>j)&1;
		int b[7]={};
		rep(j,7){
			rep(k,7){
				if(a[magic[j][k]]) b[j]+=(1<<k);
			}
			b[j]=s[b[j]]-'0';
		}
		int c=0;
		rep(k,7){
			if(b[k]) c+=(1<<k);
		}
		c=s[c]-'0';
		if(b[3]!=c) return false;
	}
	return true;
}
int main(){
	while(true){
		string s;
		cin>>s;
		if(s[0]=='#') break;
		if(solve(s)) puts("yes");
		else puts("no");
	}
}