#C5821. Beautiful Sequence

    ID: 49513 Type: Default 1000ms 256MiB

Beautiful Sequence

Beautiful Sequence

Given a sequence of integers, determine whether the sequence is beautiful. A sequence is considered beautiful if there exists at least one pair of distinct integers \(a\) and \(b\) in the sequence such that their product is a perfect square. A positive integer \(x\) is a perfect square if there exists an integer \(k\) satisfying \(x = k^2\). For example, \(4\) is a perfect square because \(2^2 = 4\).

Note: For sequences with only one element, the sequence is defined to be beautiful if and only if the single element is \(1\). Otherwise, if there is only one number (and it is not \(1\)), the sequence is not beautiful.

inputFormat

The first line contains a single integer \(n\) (\(1 \le n \le 10^5\)), representing the length of the sequence. The second line contains \(n\) space-separated integers \(a_1, a_2, \dots, a_n\) where \(1 \le a_i \le 10^9\).

outputFormat

Output a single line containing "Yes" if the sequence is beautiful, and "No" otherwise.

## sample
5
1 2 3 4 5
Yes