This page is still under construction.

Parts of this page are still being built. What you see may change.

Is N prime

Interview

Time limit1sMemory limit256 MB

Summary
Given an integer N, decide whether N is prime and print Yes or No. The trailing line of N integers is unused.
Level

Easy2 of 10

Topics
Math, Number theory, Brute force
Solved
No attempts yet

Problem

You are given an integer NN. Print Yes if NN is prime, and No otherwise.

A prime number is an integer greater than 11 whose only positive divisors are 11 and itself.

Input

The first line contains an integer NN (2≤N≤100 000)(2 \le N \le 100\,000).

The second line contains NN integers. Each integer is at least −231-2^{31} and strictly less than 2312^{31}.

Output

Print Yes if NN is prime. Print No otherwise.

Examples2

  1. Example 1

    Input
    5
    3 6 2 9 4
    
    Expected output
    Yes
    
  2. Example 2

    Input
    8
    1 3 6 10 15 21 28 36
    
    Expected output
    No