#K14396. Fibonacci Number Checker
Fibonacci Number Checker
Fibonacci Number Checker
Given an integer \(n\) (\(0 \leq n \leq 10^{18}\)), determine whether \(n\) is a number in the Fibonacci sequence. The Fibonacci sequence is defined as:
\(F_0 = 0\), \(F_1 = 1\) and for \(n \geq 2\), \(F_n = F_{n-1} + F_{n-2}\).
If \(n\) is a Fibonacci number, output YES
; otherwise, output NO
.
inputFormat
The input consists of one line containing a single integer \(n\).
outputFormat
Output a single line with YES
if \(n\) is a Fibonacci number, and NO
otherwise.
0
YES