#include #include #include #include #include #include #include #include #include #define rep(i,j,k) for(int i=(int)j;i<(int)k;i++) #define ll long long using namespace std; int day[12]={31,28,31,30,31,30,31,31,30,31,30,31}; int main(){ int n,m; cin>>n>>m; vector v(n,0); rep(i,0,m){ rep(j,0,n){ int x; cin>>x; v[j]+=x; } int left=-1,sum=0; rep(right,0,n){ sum+=v[right]; while(left777){ left++; sum-=v[left]; } if(sum==777){ cout<<"YES"<