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

using ll = long long int;
using P = pair<ll,ll>;
constexpr int INF = 1<<30;

int main() {
    int n, s[2];
    cin >> n >> s[0] >> s[1];
    s[0]--; s[1]--;
    vector<vector<int> > g(n), d(2,vector<int>(n, INF));
    for(int i=0;i<n-1;i++){
        int a, b;
        cin >> a >> b;
        a--; b--;
        g[a].push_back(b);
        g[b].push_back(a);
    }
    if(n%2){
        cout << "No" << endl;
        return 0;
    }
    for(int i=0;i<2;i++){
        d[i][s[i]] = 0;
        queue<int> que;
        que.push(s[i]);
        while(!que.empty()){
            int u = que.front();
            que.pop();
            for(auto v : g[u]){
                if(d[i][v] > d[i][u]+1){
                    d[i][v] = d[i][u]+1;
                    que.push(v);
                }
            }
        }
    }

    vector<bool> visited(n);
    visited[s[0]] = true;
    visited[s[1]] = true;
    int p[2] = {s[0], s[1]};
    bool ok = true;
    for(int i=0;i<n/2-1;i++){
        for(int j=0;j<2;j++){
            int ma = 0, nxt = -1;
            for(auto v : g[p[j]]){
                if(!visited[v] && d[j^1][v] > ma){
                    nxt = v;
                    ma = d[j^1][v];
                }
            }
            if(nxt == -1){
                ok = false;
                break;
            }
            visited[nxt] = true;
            p[j] = nxt;
        }
        if(!ok) break;
    }
    cout << (ok ? "Yes" : "No") << endl;
    return 0;
}

