#P5993. Fibonacci Product Representation

    ID: 19218 Type: Default 1000ms 256MiB

Fibonacci Product Representation

Fibonacci Product Representation

The Fibonacci sequence is defined as follows:

  • For \(k=0\) or \(k=1\), we have \(F_k=k\);
  • For \(k>1\), \(F_k=F_{k-1}+F_{k-2}\).

The beginning of the sequence is: \(0, 1, 1, 2, 3, 5, 8, 13, \dots\).

Your task is to determine whether a given number can be represented as the product of two Fibonacci numbers. In other words, check if there exist two (not necessarily distinct) Fibonacci numbers \(F_i\) and \(F_j\) such that \(F_i \times F_j = X\). If such a pair exists, output YES; otherwise, output NO.

inputFormat

The input consists of a single line containing an integer \(X\) (which may be zero or a positive number).

outputFormat

Output a single line with the string YES if \(X\) can be represented as the product of two Fibonacci numbers, or NO otherwise.

sample

0
YES