// Problem: E. Fib-tree
// Contest: Codeforces - Codeforces Global Round 13
// URL: https://codeforc.es/contest/1491/problem/E
// Memory Limit: 256 MB
// Time Limit: 1000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include<bits/stdc++.h>
#define rep(i,x,y) for(auto i=(x);i<=(y);++i)
#define dep(i,x,y) for(auto i=(x);i>=(y);--i)
#define fr first
#define sc second
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,ll>pil;
typedef pair<int,int>pii;
typedef pair<ll,ll>pll;
const int N=1e6+10;
const int inf=1e9;
const int mo=998244353;
ll a[N]={1,1};
map<ll,int> mp;
set<int> G[N];
//想了想好像直接切就行，又要假的错觉 //....原来真的是直接切就行啊  
int p,f,y,z;
bool b;
int dfs(int u,int fa){
    int res=1;
    for(auto v:G[u]){
        if(v==fa) continue;
        res+=dfs(v,u);
    }
    if(fa!=-1&&res==y) p=u,f=fa,b=0;
    if(fa!=-1&&res==z) p=u,f=fa,b=1;
    return res;
}
bool check(int u,int n){
    if(n==1) return 1;
    if(!mp.count(n)) return 0;
    p=f=0;
    y=a[mp[n]-2],z=a[mp[n]-1];
    dfs(u,-1);
    if(!p) return 0;
    else {
        G[p].erase(f);
        G[f].erase(p);
        int pp=p,ff=f,yy=y,zz=z; //确实zz*2  zz本z
        if(!b) return check(pp,yy)&&check(ff,zz);
        else return check(pp,zz)&&check(ff,yy);
    }
}
int main(){
    //freopen("D:\\in.txt","r",stdin);
    //freopen("D:\\out.txt","w",stdout);
    rep(i,2,60) a[i]=a[i-1]+a[i-2];
    rep(i,1,60) mp[a[i]]=i;
    int n; cin>>n;
    rep(i,1,n-1){
        int u,v; cin>>u>>v;
        G[u].insert(v);
        G[v].insert(u);
    }
    if(check(1,n)) cout<<"YES\n";
    else cout<<"NO\n";
    return 0;
}