Under construction

Still being built. Things may change

Product

Interview

Time limit1sMemory limit256 MB

Summary
Given up to 100,000 integers, decide whether one element equals the product of all the others and print such an element if it exists.
Level

Medium5 of 10

Topics
Math, Array, Prefix sum, Implementation
Solved
No attempts yet

Problem

Given a list of numbers, determine whether one of these numbers equals the product of all the other numbers.

Input

The first line of the input file contains a single integer NN, the number of elements in the initial list (2≤N≤1052 \leq N \leq 10^5). The next line contains NN space-separated numbers constituting the list. Each of these numbers is an integer not greater than 10910^9 in absolute value.

Output

In the first line of the output file, print Yes or No, depending on whether some number from the list is equal to the product of all the other numbers or not. If the answer is Yes, in the second line, print such a number. If several numbers satisfy the conditions of the problem, print any of them.

Examples2

  1. Example 1

    Input
    3
    2 4 2
    
    Expected output
    Yes
    4
    
  2. Example 2

    Input
    2
    2 3
    
    Expected output
    No