#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
#define yn {puts("YES");}else{puts("NO");}
#define MAX_N 200005


int now[MAX_N];
vector<int> have[MAX_N];

int nn = MAX_N; // 複数回根付き木を作成する場合は適宜変える.
vector<int> pre_G[MAX_N];
vector<int> G[MAX_N];
int par_[MAX_N];
int flag_netsukigi[MAX_N];
void make_netsukigi(int r){
    rep(i,have[r].size()){
        int j = have[r][i];
        G[j].clear();
        par_[j] = 0;
        flag_netsukigi[j] = 0;
    }
    queue<int> que;
    que.push(r);
    flag_netsukigi[r] = 1;
    par_[r] = -1;

    while(que.size() > 0){
        int x = que.front();
        que.pop();
        flag_netsukigi[x] = 1;
        rep(i,pre_G[x].size()){
            if(flag_netsukigi[pre_G[x][i]] == 0 && now[pre_G[x][i]] == r){
                par_[pre_G[x][i]] = x;
                G[x].push_back(pre_G[x][i]);
                que.push(pre_G[x][i]);
            }
        }
    }
}

int fib[300] = {};
const int INF = 1001001001;
void fibinit(){
    fib[0] = 1;
    fib[1] = 1;
    srep(i,2,300){
        fib[i] = min(fib[i-1]+fib[i-2], INF); 
        // cout << fib[i] << ' ';
    }
}


int sons[MAX_N];
int dp[MAX_N];

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    fibinit();

    int n;
    cin >> n;
    nn = n;

    rep(i,n-1){
        int a, b;
        cin >> a >> b;
        a--; b--; // 0-indexにするため.
        pre_G[a].push_back(b);
        pre_G[b].push_back(a);
    }

    int tmp_m = *lower_bound(fib,fib+300,n);
    if(tmp_m != n){
        cout << "NO" << endl;
        return 0;
    }


    queue<int> que;
    que.push(0);
    rep(i,n){
        have[0].push_back(i);
    }

    while(que.size() > 0){
        int root = que.front();
        que.pop();
        int m = have[root].size();
        if(m <= 3) continue;
        make_netsukigi(root);

        // cout << "root = " << root << endl;

        int ite = lower_bound(fib,fib+300,m) - fib;
        int target = fib[ite-1];
        int target2 = fib[ite-2];
        
        queue<int> q;
        rep(i,m){
            int y = have[root][i];
            sons[y] = G[y].size();
            dp[y] = 0;
            if(sons[y] == 0){
                q.push(y);
            }
        }
        int next = -1;
        while(q.size() > 0){
            int x = q.front();
            q.pop();
            dp[x]++;

            if(dp[x] == target || dp[x] == target2){
                next = x;
                break;
            }

            

            int pa = par_[x];
            if(par_[x] == -1) continue;
            sons[pa]--;
            dp[pa] += dp[x];
            if(sons[pa] == 0) q.push(pa);
        }
        if(next == -1){
            cout << "NO" << endl;
            return 0;
        }
        vector<int> u, v;
        queue<P> q2;
        q2.push(P(root,root));
        while(q2.size()>0){
            int x = q2.front().first;
            int oya = q2.front().second;
            q2.pop();
            if(x == next) oya = next;
            if(oya == root){
                u.push_back(x);
            }else{
                v.push_back(x);
                now[x] = oya;
            }
            rep(i,G[x].size()){
                int y = G[x][i];
                q2.push(P(y,oya));
            }
        }
        have[root] = u;
        have[next] = v;
        que.push(next);
        que.push(root);
    }

    cout << "YES" << endl;
    return 0;
}
