#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define BUFF ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define IO freopen("in.txt","r",stdin),freopen("out.txt","w",stdout)
#define P(x) cout<<x<<endl
#define P2(x,y) cout<<x<<' '<<y<<endl
#define P3(x,y,z) cout<<x<<' '<<y<<' '<<z<<endl
#define P4(x,y,z,u) cout<<x<<' '<<y<<' '<<z<<' '<<u<<endl
#define P5(x,y,z,u,v) cout<<x<<' '<<y<<' '<<z<<' '<<u<<' '<<v<<endl
#define P6(x,y,z,u,v,w) cout<<x<<' '<<y<<' '<<z<<' '<<u<<' '<<v<<' '<<w<<endl
#define PV(x) for(auto ii:(x)){cout<<ii<<' ';}cout<<endl
#define PN(x,n) for(int ii=1;ii<=(n);ii++){cout<<x[ii]<<' ';}cout<<endl
#define PNN(x,n,m) for(int ii=1;ii<=(n);ii++){for(int jj=1;jj<=(m);jj++){cout<<x[ii][jj]<<' ';}cout<<endl;}
typedef long long ll;
typedef unsigned long long ull;
const ll D = 0;
const ll N = 2e5 + 5;
const ll mod = 1e9 + 7;
const ll inf = 1e9 + 7;
const double eps = 1e-9;

ll n,u,v;
struct Node
{
    ll id;
    bool ok;
};
vector<Node> g[N];
ll fib[60];
bool is_fib[N];
ll child[N];

void dfs(ll now,ll fa,ll siz,ll* uu,ll* vv)//find child[],father[];
{
    if(D)
    {
      //  P2(now,fa);
    }
   // if((*uu)!=-1)
       // return;
    child[now]=0;
    for(Node nxt : g[now])
    {
        if(D)
        {
           // P2("size ",g[now].size());
        }
        if(nxt.ok && nxt.id!=fa)
        {
            if(D)
            {
                //P5(now,fa,"to",nxt.id,now);
            }
            dfs(nxt.id,now,siz,uu,vv);
            child[now] += child[nxt.id];
            
        }
    }
    child[now]++;
    if(now!=fa && is_fib[child[now]] && is_fib[siz - child[now]])
    {
        *uu=now;
        *vv=fa;
    }
	return;
}
bool check(ll now,ll siz)
{
   // ll child[N];
    //memset(child,0,sizeof(child));
    if(siz==1)
        return true;
    ll uu=-1,vv=-1;
    dfs(now,now,siz,&uu,&vv);
    if(D)
    {
        PN(child,n);
    }
    
    if(D)
    {
        P4("find",uu,vv,siz);
    }
    
    if(!is_fib[siz])
        return false;
    if(uu==-1 || vv==-1)
        return false;
    for(Node &nxt : g[uu])
    {
        if(nxt.id == vv)
        {
            nxt.ok = false;
            break;
        }
    }
    for(Node &nxt : g[vv])
    {
        if(nxt.id == uu)
        {
            nxt.ok = false;
            break;
        }
    }
     if(D)
    {
        P6(now,"to",uu,vv,"in",siz);
        
    }
    ll siz2 = child[uu];
    bool res = check(uu,siz2) && check(vv,siz - siz2);//fa
    for(Node &nxt : g[uu])
    {
        if(nxt.id == vv)
        {
            nxt.ok = true;
            break;
        }
    }
    for(Node &nxt : g[vv])
    {
        if(nxt.id == uu)
        {
            nxt.ok = true;
            break;
        }
    }
    return res;
}

int solve()
{
    fib[0]=fib[1]=1;
    is_fib[1]=true;
    for(ll i=2;;i++)
    {
        fib[i] = fib[i-1] + fib[i-2];
        if(fib[i]>2e5)
            break;
        is_fib[fib[i]] = true;
    }

	cin>>n;
    
    for(ll i=1;i<=n-1;i++)
    {
        cin>>u>>v;
        g[u].push_back({v,true});
        g[v].push_back({u,true});
    }
    //u = v = -1;
    
    cout<<(check(1,n)?"YES\n":"NO\n");
	return 0;
}

int main()
{
	//BUFF;
	if(D)IO;
	ll t=1;
	//cin>>t;
	while(t--)
	{
		solve();
	}
	return 0;
}