#include <iostream>
using namespace std;
int main()
{
int p;
cin>>p;
const int n=p;
int a[n][n];
for(int i=0; i<n; i++)
for(int j=0; j<n; j++)
{
cin>>a[i][j];
}
int s=0;
bool f=false;
for(int i=0; i<n; i++)
{
s=0;
for(int j=0; j<n; j++)
{
if(a[i][j]==2) s++;
}
if(s>((n-1)/2)) f=true;
}
if(f)
cout<<"Yes"<<endl;
else
cout<<"No"<<endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSAKewoJaW50IHA7CgljaW4+PnA7Cgljb25zdCBpbnQgbj1wOwoJaW50IGFbbl1bbl07Cglmb3IoaW50IGk9MDsgaTxuOyBpKyspCgkJZm9yKGludCBqPTA7IGo8bjsgaisrKQoJCXsKCQkJY2luPj5hW2ldW2pdOwoJCX0KCWludCBzPTA7Cglib29sIGY9ZmFsc2U7Cglmb3IoaW50IGk9MDsgaTxuOyBpKyspCgl7CgkJcz0wOwoJCWZvcihpbnQgaj0wOyBqPG47IGorKykKCQl7CgkJCWlmKGFbaV1bal09PTIpIHMrKzsKCQl9CgkJaWYocz4oKG4tMSkvMikpIGY9dHJ1ZTsKCX0KCWlmKGYpCiAgICAJY291dDw8IlllcyI8PGVuZGw7CgllbHNlCiAgICAJY291dDw8Ik5vIjw8ZW5kbDsKCXJldHVybiAwOwp9