#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define pb push_back
#define IOS ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define mem(a) memset(a, 0, sizeof(a))
#define LP pair<ll, int>
#define LPP pair<LP, int>
#define LPPP pair<LPP, int>
using namespace std;
typedef long long ll;
typedef unsigned long long ul;
typedef long double ld;
typedef double db;
typedef pair<int, int> P;
const int maxn = 2e5 + 10;
int t, n, vis[maxn], fib[maxn], sz[maxn], ok = 1;
vector<P> ns[maxn];
void setSize(int u, int fa){
    sz[u] = 1;
    for(pair<int, bool> e : ns[u])
    {
        if(!e.second) continue;
        int v = e.first;
        if(v == fa) continue;
        setSize(v, u);
        sz[u] += sz[v];
    }
}
void cut(int u, int fa, int k, int& nu, int &nv, int &sta){
    for (auto tmp : ns[u]) {
        if(sta) return;
        if(!tmp.second) continue;
        int vv = tmp.first;
        if(vv == fa) continue;
        if(sz[vv] == fib[k - 1] || sz[vv] == fib[k - 2]){
            nu = u, nv = vv, sta = (sz[vv] == fib[k - 1]) ? k - 1 : k - 2;
            break;
        }
        cut(vv,  u, k, nu, nv, sta);
    }
}
void check(int u, int val){//check as fa = u, has fib[val] nodes
    if(fib[val] <= 1) return;
    setSize(u, 0);
    int pv = 0, kd = 0,pu = 0;
    cut(u, 0, val, pu, pv, kd);
//    if(n == 121393 || n == 196418) return;
 
    if(kd == 0) {
        ok = 0;
        printf("NO\n");
        exit(0);
    }
    for (auto &tmp : ns[pv]) if(tmp.first == pu) tmp.second = 0;//make as a visit
    for (auto &tmp : ns[pu]) if(tmp.first == pv) tmp.second = 0;
    check(pv, kd);
    check(pu, (kd == val - 1) ? val - 2 : val - 1);
}
 
int main(){
//    freopen("1.in", "w", stdout);
//    printf("200000\n");
//    for (int i = 1; i < 196418; ++i) {
//        printf("%d %d\n", i, i + 1);
//    }
//    return 0;
//    freopen("1.in", "r", stdin);
    mem(fib), mem(vis);
    int u, v;
    fib[1] = fib[2] = 1, t = 3, u = 2, vis[1] = 1;
    while (u < maxn) vis[u] = t, fib[t] = u, u = fib[t - 1] + fib[t], t++;
 
    scanf("%d", &n);
    if(!vis[n]) {
        printf("NO\n");
        return 0;
    }
    for (int i = 1; i < n; ++i) {
        scanf("%d%d", &u, &v);
        ns[u].push_back(make_pair(v, 1)), ns[v].push_back(make_pair(u, 1));
    }
    check(1, vis[n]);
    printf("%s\n", ok ? "YES" : "NO");
}