#include using namespace std; #define rep_(i, a_, b_, a, b, ...) for (int i = (a), lim##i = (b); i < lim##i; ++i) #define rep(i, ...) rep_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__) #define drep_(i, a_, b_, a, b, ...) for (int i = (a) - 1, lim##i = (b); i >= lim##i; --i) #define drep(i, ...) drep_(i, __VA_ARGS__, __VA_ARGS__, __VA_ARGS__, 0) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #ifdef LOCAL void debug_out() { cerr << endl; } template void debug_out(Head H, Tail... T) { cerr << ' ' << H; debug_out(T...); } #define debug(...) cerr << 'L' << __LINE__ << " [" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__) #define dump(x) cerr << 'L' << __LINE__ << " " << #x << " = " << (x) << endl #else #define debug(...) (void(0)) #define dump(x) (void(0)) #endif using ll = long long; using ld = long double; template using priority_queue_rev = priority_queue, greater>; template vector make_vec(size_t n, T a) { return vector(n, a); } template auto make_vec(size_t n, Ts... ts) { return vector(n, make_vec(ts...)); } template inline void fin(const T x) { cout << x << '\n'; exit(0); } template inline void deduplicate(vector &a) { sort(all(a)); a.erase(unique(all(a)), a.end()); } template inline bool chmin(T &a, const T b) { if (a > b) { a = b; return true; } return false; } template inline bool chmax(T &a, const T b) { if (a < b) { a = b; return true; } return false; } template inline int sz(const T &x) { return x.size(); } template inline int count_between(const vector &a, T l, T r) { return lower_bound(all(a), r) - lower_bound(all(a), l); } template istream &operator>>(istream &is, pair &p) { is >> p.first >> p.second; return is; } template ostream &operator<<(ostream &os, pair &p) { os << '(' << p.first << ", " << p.second << ')'; return os; } template istream &operator>>(istream &is, array &v) { for (auto &e : v) is >> e; return is; } template ostream &operator<<(ostream &os, array &v) { for (auto &e : v) os << e << ' '; return os; } template istream &operator>>(istream &is, vector &v) { for (auto &e : v) is >> e; return is; } template ostream &operator<<(ostream &os, vector &v) { for (auto &e : v) os << e << ' '; return os; } template istream &operator>>(istream &is, deque &v) { for (auto &e : v) is >> e; return is; } template ostream &operator<<(ostream &os, deque &v) { for (auto &e : v) os << e << ' '; return os; } inline ll floor_div(ll x, ll y) { if (y < 0) x = -x, y = -y; return x >= 0 ? x / y : (x - y + 1) / y; } inline ll ceil_div(ll x, ll y) { if (y < 0) x = -x, y = -y; return x >= 0 ? (x + y - 1) / y : x / y; } inline int floor_log2(const ll x) { assert(x > 0); return 63 - __builtin_clzll(x); } inline int ceil_log2(const ll x) { assert(x > 0); return (x == 1) ? 0 : 64 - __builtin_clzll(x - 1); } inline int popcount(const ll x) { return __builtin_popcountll(x); } struct fast_ios { fast_ios() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios; // 時間計測 auto system_now = std::chrono::system_clock::now(); int check_time() { auto now = std::chrono::system_clock::now(); return std::chrono::duration_cast(now - system_now).count(); } // 乱数 struct Xorshift { uint32_t x = 123456789, y = 362436069, z = 521288629, w = 88675123; uint32_t rand_int() { uint32_t t = x ^ (x << 11); x = y; y = z; z = w; return w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); } // 0以上mod未満の整数を乱択 uint32_t rand_int(uint32_t mod) { return rand_int() % mod; } // l以上r未満の整数を乱択 uint32_t rand_int(uint32_t l, uint32_t r) { assert(l < r); return l + rand_int(r - l); } // 0以上1以下の実数を乱沢 double rand_double() { return (double)rand_int() / UINT32_MAX; } }; Xorshift xor_shift; // constexpr int INF = numeric_limits::max() >> 2; // constexpr ll INFll = numeric_limits::max() >> 2; // constexpr ld EPS = 1e-10; // const ld PI = acos(-1.0); // using mint = modint998244353; // using mint = modint1000000007; // using mint = modint; // using Vm = V; using VVm = VV; int main() { int N; cin >> N; map cnt; vector> S(N, vector(2)); rep(i, N) { cin >> S[i][0] >> S[i][1]; cnt[S[i][0]]++; cnt[S[i][1]]++; } bool ok = true; rep(i, N) { if (cnt[S[i][0]] > 1 && cnt[S[i][1]] > 1) { ok = false; break; } } cout << (ok ? "Yes" : "No") << endl; return 0; }