#include #include using namespace std; int main() { int n; cin >> n; string s[n], t[n]; for (int i = 0; i < n; i++) { cin >> s[i] >> t[i]; } bool ans = true; for (int i = 0; i < n; i++) { bool fs = true, ft = true; for (int j = 0; j < n; j++) { if (i == j) { continue; } if (s[i] == s[j] || s[i] == t[j]) { fs = false; } if (t[i] == s[j] || t[i] == t[j]) { ft = false; } } if (!fs && !ft) { ans = false; } } cout << (ans ? "Yes" : "No") << endl; return 0; }