#include using namespace std; using Graph=vector>; void rep(int v,int pv,int d,vector &res,Graph &g){ res[v]=d; for(auto &nx : g[v]){ if(nx==pv){continue;} rep(nx,v,d+1,res,g); } } int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; Graph g(n); for(int i=1;i> u >> v; u--;v--; g[u].push_back(v); g[v].push_back(u); } for(int i=0;i2){break;} if(i==n-1){cout << "Yes\n";return 0;} } int lf; for(int i=0;i d(n); rep(lf,-1,0,d,g); int fv=0; for(int i=0;i