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

#SP0000198. Nhận biết số hoàn hảo theo số mũ (Perfect Numbers)

HỌC THEO LỘ TRÌNH

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

1 lộ trình

Nhận biết số hoàn hảo theo số mũ (Perfect Numbers)

Perfect Numbers

Phuoc Hung OJ ID: PRIME000203
Original source: UVa 1180

Problem statement

Given pp, determine whether 2p−1(2p−1)2^{p-1}(2^p-1) is a perfect number, meaning it equals the sum of its positive proper divisors.

Input

One integer pp.

Output

Print exactly Yes if 2p−1(2p−1)2^{p-1}(2^p-1) is perfect, or No otherwise.

Subtasks

  • Subtask 1 (20 points): 2≤p≤72\le p\le 7.
  • Subtask 2 (30 points): 8≤p≤138\le p\le 13.
  • Subtask 3 (50 points): 14≤p≤1814\le p\le 18.

Example

Input

7

Output

Yes

Explanation: 27−1=1272^7-1=127 is prime; by the Euclid–Euler theorem, 26(27−1)=81282^6(2^7-1)=8128 is perfect.