4598: Fibonacci Cane
内存限制:128 MB
时间限制:1 S
标准输入输出
题目类型:传统
评测方式:Special Judge
上传者:
提交:3
通过:0
题目描述
Bob likes Fibonacci numbers too much. When he buys sugar canes, he hopes that the length of the sugar cane is a continuous sum of Fibonacci sequence.
Fibonacci sequence is a sequence that: f0 = 1, f1 = 1, …, fn = fn − 1 + fn − 2.
He asks you to help determine whether a sugar cane is what he wants.
输入格式
No more than 1000 test cases. Each case contains a positive integer n, the length of a sugar cane.
1 ≤ n ≤ 1015
输出格式
Output YES if the length is a continuous sum of the Fibonacci sequence, otherwise output NO.
输入样例 复制
1
2
5
9
10
输出样例 复制
YES
YES
YES
NO
YES