#include using namespace std; void solve() { int n; cin >> n; vector v(n), w(n); for (int i = 0; i < n; i++) cin >> v[i] >> w[i]; if (count(w.begin(), w.end(), 1)) cout << "Yes" << endl; else cout << "No" << endl; } int main() { cin.tie(0); ios::sync_with_stdio(false); /*int t; cin >> t; while (t--)*/ solve(); }