#include using namespace std; int main(){ int i,n; cin >> n; for(i=0;i> u >> w; if(w==1){ cout << "Yes\n"; return 0; } } cout << "No\n"; }