Problem: Let denote the -th term of Fibonacci sequence, defined as below:
- for any integer ,
You are given a tree with vertices. Recall that a tree is a connected undirected graph without cycles.
We call a tree a Fib-tree, if its number of vertices equals for some , and at least one of the following conditions holds:
- The tree consists of only vertex;
- You can divide it into two Fib-trees by removing some edge of the tree.
Determine whether the given tree is a Fib-tree or not.
Input Format: The first line of the input contains a single integer () — the number of vertices in the tree.
Then lines follow, each of which contains two integers and (, ), representing an edge between vertices and . It's guaranteed that given edges form a tree.
Output Format: Print "YES" if the given tree is a Fib-tree, or "NO" otherwise.
You can print your answer in any case. For example, if the answer is "YES", then the output "Yes" or "yeS" will also be considered as correct answer.
Note: In the first sample, we can cut the edge , and the tree will be split into trees of sizes and correspondently. Any tree of size is a Fib-tree, as it can be split into trees of size .
In the second sample, no matter what edge we cut, the tree will be split into trees of sizes and . As isn't for any , it's not Fib-tree.
In the third sample, here is one possible order of cutting the edges so that all the trees in the process are Fib-trees: .