#include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(x) (x).begin(), (x).end() using ll = long long; int main() { int n; cin >> n; vector> temp(n, vector()); rep(i, n) { string s, t; cin >> s >> t; temp[i].push_back(s); temp[i].push_back(t); } rep(i, n) { bool ok_s = true; bool ok_t = true; rep(j, n) { if (i == j) continue; if (temp[i][0] == temp[j][0] || temp[i][0] == temp[j][1]) ok_s = false; if (temp[i][1] == temp[j][0] || temp[i][1] == temp[j][1]) ok_t = false; } if (!ok_s && !ok_t) { cout << "No" << endl; return 0; } } cout << "Yes" << endl; return 0; }