#include using namespace std; using ll=long long; int main(){ ll n; cin>>n; bool ans=0; for(int i=0;i>a>>b; if(a==1)ans=1; } if(ans) cout<<"Yes"<