#include<bits/stdc++.h>
#define For(i,a,b) for(register int i=(a);i<=(b);++i)
#define Rep(i,a,b) for(register int i=(a);i>=(b);--i)
using namespace std;
inline int read()
{
    char c=getchar();int x=0;bool f=0;
    for(;!isdigit(c);c=getchar())f^=!(c^45);
    for(;isdigit(c);c=getchar())x=(x<<1)+(x<<3)+(c^48);
    if(f)x=-x;return x;
}
#define maxn 200005
#define pb push_back
int n,fib[45];
set<int>e[maxn];
map<int,int>mp;

int sz[maxn],fa[maxn];
int o1,o2;
inline void dfs(int u,int pa,int d){
	sz[u]=1,fa[u]=pa;
	for(auto v:e[u])if(v!=pa)dfs(v,u,d),sz[u]+=sz[v];
	if(sz[u]==fib[d-1])o1=u;
	if(sz[u]==fib[d-2])o2=u;
}
inline void cut(int u,int v){
	e[u].erase(v),e[v].erase(u);
}
bool check(int u,int d)
{
	if(fib[d]<=3)return 1;
	o1=o2=-1,dfs(u,0,d);
	int t1=o1,t2=o2,ft1=fa[t1],ft2=fa[t2];
	if(t2!=-1)return cut(t2,ft2),check(t2,d-2)&&check(ft2,d-1);
	if(t1!=-1)return cut(t1,ft1),check(t1,d-1)&&check(ft1,d-2);
	return 0;
}

signed main()
{
	n=read();
	fib[0]=fib[1]=1; mp[1]=1;
	For(i,2,35)fib[i]=fib[i-1]+fib[i-2],mp[fib[i]]=i;
	For(i,2,n){
		int u=read(),v=read();
		e[u].insert(v),e[v].insert(u);
	}
	if(!mp.count(n))puts("NO");
	else {
		if(check(1,mp[n]))puts("YES");
		else puts("No");
	}
    return 0;
}