#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <complex>

using namespace std;
using ll = long long;

const int MN = 200200;
vector<int> g[MN];
int sz[MN], rt[MN];
void dfs(int p, int b) {
    sz[p] = 1;
    rt[p] = b;
    for (int d: g[p]) {
        if (d == b) continue;
        dfs(d, p);
        sz[p] += sz[d];
    }
}

vector<int> g2[MN];

bool ispath(int s) {
    if (g2[s].size() >= 2) return false;
    if (g2[s].size() == 0) return true;
    int b = -1;
    int p = s;
    while (true) {        
        for (int d: g2[p]) {
            if (d == b) continue;
            b = p;
            p = d;
            break;
        }
        if (g2[p].size() == 1) return true;
        if (g2[p].size() > 2) return false;        
    }
}

bool solve() {
    int n, u, v;
    cin >> n >> u >> v; u--; v--;
    if (n % 2) return false;
    static int A[MN], B[MN];
    for (int i = 1; i < n; i++) {
        int a, b;
        cin >> a >> b; a--; b--;
        A[i] = a; B[i] = b;
        g[a].push_back(b);
        g[b].push_back(a);
    }
    dfs(u, -1);
    int st = v;
    while (true) {
        if (sz[st] > n/2) {
            return false;
        }
        if (sz[st] == n/2) {
            break;
        }
        st = rt[st];
    }

    for (int i = 1; i < n; i++) {
        int a = A[i], b = B[i];
        if (rt[b] == a) swap(a, b);
        if (a == st) continue;
        g2[a].push_back(b);
        g2[b].push_back(a);
    }
    return (ispath(u) && ispath(v));
}

int main2() {
    if (solve()) {
        printf("Yes\n");
    } else {
        printf("No\n");
    }
    return 0;
}

int main() {
    static ll eord, enew;
    const int sz = 256*1024*1024;
    static unsigned char *p = (unsigned char*)malloc(sz);
    enew = ((ll)(p+sz-1) & ~0xff);
    __asm__ volatile("mov %%rsp, %0" : "=r"(eord));
    __asm__ volatile("mov %0, %%rsp" : : "r"(enew));
    main2();
    __asm__ volatile("mov %0, %%rsp" : : "r"(eord));
    return 0;
}