﻿#include <bits/stdc++.h>
using namespace std;

const int maxn = 2e5 + 5;
vector<int> fib;
typedef pair<int, bool> P;
vector<P> e[maxn];
int siz[maxn];
int n;

void no() { printf("NO"); exit(0); }

void getSize(int u, int fa) {
	siz[u] = 1;
	for (auto& i : e[u]) {
		if (i.second || i.first == fa) continue;
		getSize(i.first, u);
		siz[u] += siz[i.first];
	}
}

void cutEdge(int u, int fa, int k, int& pu, int& pv, int& kd) {
	for (auto& i : e[u]) {
		if (pu) return;
		if (i.second || i.first == fa) continue;
		if (siz[i.first] == fib[k - 1] || siz[i.first] == fib[k - 2]) {
			pu = u, pv = i.first;
			kd = siz[i.first] == fib[k - 1] ? k - 1 : k - 2;
			return;
		}
		cutEdge(i.first, u, k, pu, pv, kd);
	}
}

void Check(int u, int k) {
	if (k <= 1) return;
	getSize(u, 0);
	int pu = 0, pv = 0, kd = 0;
	cutEdge(u, 0, k, pu, pv, kd);
	if (!pu) no();
	for (auto& i : e[pu])
		if (i.first == pv) i.second = true;
	for (auto& i : e[pv])
		if (i.first == pu) i.second = true;
	Check(pv, kd);
	Check(pu, 2 * k - 3 - kd);
}

int main() {
	int u, v;
	scanf("%d", &n);
	fib.push_back(1), fib.push_back(1);;
	while (fib.back() < n)
		fib.push_back(fib[fib.size() - 1] + fib[fib.size() - 2]);
	for (int i = 1; i < n; ++i) {
		scanf("%d%d", &u, &v);
		e[u].push_back(P(v, false));
		e[v].push_back(P(u, false));
	}
	if (fib.back() != n) no();
	Check(1, fib.size() - 1);
	printf("YES");
}