PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#GL0000166. Số T-nguyên tố (T-primes)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

2 lộ trình

Số T-nguyên tố (T-primes)

T-primes

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

A positive integer is called a T-prime if it has exactly three distinct positive divisors. Given nn positive integers x1,x2,…,xnx_1,x_2,\ldots,x_n, determine independently for each number whether it is a T-prime. Preserve the original order.

Input

The first line contains nn. The next line contains nn positive integers xix_i.

Output

Print nn lines, YES for a T-prime and NO otherwise, in the same order.

Subtasks

  • Subtask 1 (20 points): 1≤n≤1001 \le n \le 100; 1≤xi≤1051 \le x_i \le 10^5.
  • Subtask 2 (30 points): 1≤n≤1041 \le n \le 10^4; 1≤xi≤1081 \le x_i \le 10^8.
  • Subtask 3 (50 points): 1≤n≤1051 \le n \le 10^5; 1≤xi≤10121 \le x_i \le 10^12.

Examples

Input

5
4 9 25 6 1

Output

YES
YES
YES
NO
NO

Explanation

44 has divisors 1,2,41,2,4; 99 has 1,3,91,3,9; 2525 has 1,5,251,5,25, so each has exactly three. The number 66 has four divisors, and 11 has only one.