This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// URI OJ : 1267 (Pascal Library) | |
/// Author : Shohanur Rahaman | |
/// Probem Type : Ad-Hoc | |
#include<stdio.h> | |
int main() | |
{ | |
int i,j,tmp,ck; | |
int ara[500][500]; | |
int d,n; | |
while(scanf("%d %d",&n,&d)==2){ | |
if(n==0 && d==0) | |
break; | |
for(j=0;j<d;j++){ | |
for(i=0;i<n;i++){ | |
scanf("%d",&ara[j][i]); | |
} | |
} | |
ck=0; | |
tmp=0; | |
for(i=0;i<n;i++){ | |
tmp=0; | |
for(j=0;j<d;j++){ | |
tmp=tmp+ara[j][i]; | |
if(tmp==d){ | |
ck=1; | |
break; | |
} | |
} | |
} | |
if(ck==1) | |
printf("yes\n"); | |
else | |
printf("no\n"); | |
} | |
return 0; | |
} |