#include <bits/stdc++.h>
#define IO_OP std::ios::sync_with_stdio(0); std::cin.tie(0);
#define F first
#define S second
#define V vector
#define PB push_back
#define MP make_pair
#define EB emplace_back
#define ALL(v) (v).begin(), (v).end()
#define debug(x) cerr << "Line(" << __LINE__ << ") -> " << #x << " is " << x << endl

using namespace std;

typedef long long ll;
typedef pair<int, int> pi;
typedef V<int> vi;

const int INF = 1e9 + 7, N = 2e5 + 7;

int fib[N];
vi G[N];
int vis[N], sz[N], pa[N];

void dfs_sz(int u, vi& who, int p = 0) {
	pa[u] = p;
	sz[u] = 1;
	who.PB(u);
	assert(vis[u] == 0);
	for(int v:G[u]) if(v != p && !vis[v]) {
		dfs_sz(v, who, u);
		sz[u] += sz[v];
	}
}

bool yes(int u) {
	vi who;
	dfs_sz(u, who);
	if(sz[u] <= 2) return true;
	assert(fib[sz[u]]);
	int y = fib[sz[u]], x = sz[u] - fib[sz[u]];
	assert(fib[x] && fib[y]);
	for(int v:who) {
		if(sz[v] == x || sz[v] == y) {
			assert(v != u);
			int sa = v, na = pa[sa];
			vis[sa] = 1;
			if(yes(na)) {
				vis[sa] = 0;
				vis[na] = 1;
				if(yes(sa)) {
					vis[na] = 0;
					return true;
				}
				vis[na] = 0;
			}
			vis[sa] = 0;
			break;
		}

	}
	return false;
}

signed main()
{
	IO_OP;

	fib[1] = 1;
	int x = 1, y = 1;
	while(x + y < N) {
		int z = x + y;
		fib[z] = y;
		x = y, y = z;
	}

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

	if(!fib[n]) {
		cout << "NO\n";
		return 0;
	}
	if(yes(1)) cout << "YES\n";
	else cout << "NO\n";

}



