0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-09 01:58:48 +00:00
OI-codes/AtCoder/ABC225/B/B.cpp

24 lines
414 B
C++
Raw Normal View History

#include <bits/stdc++.h>
using namespace std;
int n, a, b;
vector<int> g[100005];
int main() {
cin >> n;
for (int i = 1; i < n; i++) {
cin >> a >> b;
g[a].push_back(b);
g[b].push_back(a);
}
for (int i = 1; i <= n; i++) {
if (g[i].size() == n - 1) {
cout << "Yes" << endl;
exit(0);
}
}
cout << "No" << endl;
return 0;
}