#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
#define rep(i,a,b) for(int (i)=(a);(i)<(b);i++)
typedef long long ll;

int n;
bool ans = true;
int fib[30];
vector<int> d[200007];
int w[200007];


int ta, tb;

bool FibQ(int n) {
    return n == *lower_bound(fib + 1, fib + 30, n);
}

class node {
public:
    int pos, len;
    bool operator < (node b) const{
        return pos < b.pos;
    }
};

void fusing(int x, int y) {
    for (int& a : d[x]) {
        if (a == y) {
            a = 0;
            break;
        }
    }
    for (int& a : d[y]) {
        if (a == x) {
            a = 0;
            break;
        }
    }
}

queue<node> q;
bool cond;
int cs;

int find_w(int x, int f) {
    if (cond == 1) return 0;
    w[x] = 1;
    for (int a : d[x]) {
        if (a != f && a) {
            w[x] += find_w(a, x);
        }
    }
    if (cond == 1) return 0;
    if (w[x] == ta || w[x] == tb) {
        fusing(x, f);
        int wf = cs - w[x];
        if (w[x] > 3) q.push(node{x, w[x]});
        if (wf > 3) q.push(node{f, wf});
        cond = 1;
    }
    return w[x];
}



int main()
{
    fib[1] = fib[2] = 1;
    rep(i, 3, 30) {
        fib[i] = fib[i - 1] + fib[i - 2];
    }
    scanf("%d", &n);
    rep(i, 0, n - 1) {
        scanf("%d%d", &ta, &tb);
        d[ta].push_back(tb);
        d[tb].push_back(ta);
    }
    if (!FibQ(n)) {
        cout << "NO" << endl;
        return 0;
    }
    if (n <= 3) {
        cout << "YES" << endl;
        return 0;
    }
    q.push(node{1, n});
    while(!q.empty()) {
        node t = q.front();
        q.pop();
        cs = t.len;
        ll tp = lower_bound(fib + 1, fib + 30, cs) - fib;
        ta = fib[tp - 1];
        tb = fib[tp - 2];
        cond = 0;
        find_w(t.pos, 0);
        if (cond == 0) {
            ans = 0;
            break;
        }
    }
    if (ans) cout << "YES" << endl;
    else cout << "NO" << endl;
    return 0;
}
