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

constexpr int N = 2e5 + 5;

vector<pair<int, int> > edges[N];
int n, fib[30] = {1, 1}, c[N];
bool on[N], visited[N];

int cnt(int id, int par = -1){
    c[id] = 1;
    for(pair<int, int> p : edges[id]){
        if(on[p.second] && p.first != par){
            c[id] += cnt(p.first, id);
        }
    }
    return c[id];
}

//num-ban a[0]ban legyen num-1, masikban num-2

void dfs(int id, int num, vector<array<int, 3> > &el, int par = -1){
    for(pair<int, int> p : edges[id]){
        if(on[p.second] && p.first != par){

            dfs(p.first, num, el, id);

            if(c[p.first] == fib[num-1])
                el.push_back({p.first, id, p.second});
            else if(c[p.first] == fib[num-2])
                el.push_back({id, p.first, p.second});
        }
    }
}

bool decomp(int id, int num){

    if(num == 1 || num == 0)
        return 1;

    bool jo = 0;
    cnt(id);
    vector<array<int, 3> > el;
    dfs(id, num, el);
    for(array<int, 3> a : el){
        on[a[2]] = 0;
        jo = (decomp(a[0], num - 1) && decomp(a[1], num - 2));
        on[a[2]] = 1;
        break;
    }
    return jo;


}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    for(int i = 2; i < 30; i++)
        fib[i] = fib[i-1] + fib[i-2];
    fill(on, on + N, 1);

    int n;
    cin >> n;

    for(int i = 0; i < n - 1; i++){
        int u, v;
        cin >> u >> v;
        edges[u-1].emplace_back(v-1, i);
        edges[v-1].emplace_back(u-1, i);
    }

    int num = find(fib, fib + 30, n) - fib;

    if(num == 30)
        puts("NO");
    else
        puts(decomp(0, num) ? "YES" : "NO");

}
