#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcount

const int N = 100005;
vector<int> g[N];
int cnt[N];
// P es[N];
vector<P> es;
int col[N];
int deg[N];

void dfs(ll v,ll pre){
  cnt[v]=1;
  for(ll nv : g[v]){
    if(nv==pre)continue;
    dfs(nv,v);
    cnt[v]+=cnt[nv];
  }
}

void ddfs(ll v,ll pre,ll c){
  col[v]=c;
  for(ll nv : g[v]){
    if(nv==pre)continue;
    ddfs(nv,v,c);
  }
}

bool solve(){
  int n,x,y;
  scanf("%d%d%d", &n, &x, &y);
  x--; y--;

  // memset(deg,0,sizeof(deg));

  rep(i,n-1){
    int a,b;
    scanf("%d%d", &a, &b);
    a--;b--;
    g[a].push_back(b);
    g[b].push_back(a);
    // es[i] = {a,b};
    es.push_back({a,b});
    deg[a]++;
    deg[b]++;
  }

  if(n==2) return true;
  if(n%2==1) return false;

  dfs(0,-1);
  memset(col,-1,sizeof(col));
  rep(i,n-1){
    ll a=es[i].fi, b=es[i].se;
    if(cnt[a]<cnt[b]) swap(a,b);
    if(cnt[b]==n-cnt[b]){
      ddfs(a,b,0);
      ddfs(b,a,1);
      deg[a]--;
      deg[b]--;
      break;
    }
  }

  if(col[x]==col[y]) return false;

  int cnt1[2] = {0,0};
  rep(i,n){
    if(deg[i]>2) return false;
    if(deg[i]==1) cnt1[col[i]]++;
  }

  if(cnt1[0]!=2 || cnt1[1]!=2) return false;

  return (deg[x]==1 && deg[y]==1);
}

int main(){
  if(solve()) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}

