#include <bits/stdc++.h>

using namespace std;

#define all(v) (v).begin(), (v).end()
#define sz(v) (int)(v).size()

typedef long long ll;
typedef pair<int, int> pii;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());


struct Edge {
    int u, v;
    bool used = false;
    
    Edge() {}
    Edge(int u, int v): u(u), v(v) {}
};

const int N = (int)2e5 + 5;
const int MAX = 30;

int f[MAX];
int sz[N], par[N];
vector<int> g[N];
vector<Edge> edges;

int getOther(int v, int i) {
    return v ^ edges[i].v ^ edges[i].u;
}

void dfs(int v, int p, vector<int>& comp) {
    comp.push_back(v);
    par[v] = p;
    sz[v] = 1;
    for (int i : g[v]) {
        if (edges[i].used) continue;
        int u = getOther(v, i);
        if (u == p) continue;
        dfs(u, v, comp);
        sz[v] += sz[u];
    }
}

bool solve(int v, int k) {
    if (k <= 3) return true;
    vector<int> comp;
    dfs(v, 0, comp);
    for (int x : comp) {
        if (sz[x] == f[k - 1] || sz[x] == f[k - 2]) {
            int y = par[x];
            for (int i : g[x]) {
                if (getOther(x, i) == y) {
                    edges[i].used = true;
                    if (sz[x] == f[k - 1]) {
                        return solve(x, k - 1) && solve(y, k - 2);
                    } else {
                        return solve(x, k - 2) && solve(y, k - 1);
                    }
                }
            }
        }
    }
    return false;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    
    int n;
    cin >> n;
    int k = (n == 1 ? 1 : -1);
    
    f[0] = f[1] = 1;
    for (int i = 2; i < MAX; ++i) {
        f[i] = f[i - 1] + f[i - 2];
        if (f[i] == n) {
            k = i;
            break;
        }
    }
    
    
    if (k == -1) {
        cout << "NO\n";
        return 0;
    }
    
    for (int i = 0; i < n - 1; ++i) {
        int u, v;
        cin >> u >> v;
        g[u].push_back(i);
        g[v].push_back(i);
        edges.push_back(Edge(u, v));
    }
    cout << (solve(1, k) ? "YES\n" : "NO\n");
}