#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include<assert.h>
#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
int main(){
int T;
int i, j, k, in[120][120];
int same[120][120];
int res, cnt = 0;
char buf[10];
assert( scanf("%d",&T)==1 );
rep(i,T) rep(j,T){
assert( scanf("%s",buf)==1 );
if(strcmp(buf,"YES")==0) in[i][j] = 1;
else if(strcmp(buf,"NO") ==0) in[i][j] = 0;
else assert(0);
}
rep(i,T){
k = 0;
rep(j,T) if(in[i][j]==1) k++;
if(k==0) break;
}
if(i==T) res=-1, cnt++; /* All "NO" is a valid output */
rep(i,T) rep(j,T){
same[i][j] = 1;
rep(k,T) if(in[i][k]!=in[j][k]){ same[i][j]=0; break; }
}
rep(i,T){
REP(j,i+1,T) if(same[i][j]) break;
if(j<T) continue;
rep(j,T) if(in[i][j] != same[i][j]) break;
if(j==T) res = i, cnt++; /* It is a valid output that is the same as the i-th input */
}
assert(cnt==1); /* output should be determined uniquely */
if(res==-1){
rep(i,T) puts("NO");
} else {
rep(i,T) if(in[res][i]) puts("YES"); else puts("NO");
}
return 0;
}
I2luY2x1ZGU8c3RkaW8uaD4KI2luY2x1ZGU8c3RkbGliLmg+CiNpbmNsdWRlPG1hdGguaD4KI2luY2x1ZGU8c3RyaW5nLmg+CiNpbmNsdWRlPGFzc2VydC5oPgojZGVmaW5lIFJFUChpLGEsYikgZm9yKGk9YTtpPGI7aSsrKQojZGVmaW5lIHJlcChpLG4pIFJFUChpLDAsbikKCmludCBtYWluKCl7CiAgaW50IFQ7CiAgaW50IGksIGosIGssIGluWzEyMF1bMTIwXTsKICBpbnQgc2FtZVsxMjBdWzEyMF07CiAgaW50IHJlcywgY250ID0gMDsKICBjaGFyIGJ1ZlsxMF07CgogIGFzc2VydCggc2NhbmYoIiVkIiwmVCk9PTEgKTsKICByZXAoaSxUKSByZXAoaixUKXsKICAgIGFzc2VydCggc2NhbmYoIiVzIixidWYpPT0xICk7C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