#P10567. 「Daily OI Round 4」Square

    ID: 11476 远端评测题 1000ms 512MiB 尝试: 0 已通过: 0 难度: 3 上传者: 标签>数学洛谷原创O2优化洛谷月赛Ad-hoc

「Daily OI Round 4」Square

Problem Description

Little A gives you a square grid with side length nn. You need to fill this grid with the numbers 1n×n1 \sim n \times n, such that the sum of numbers in every row is odd, and the sum of numbers in every column is even.

Before filling it, you want to know whether there exists any solution that satisfies the conditions above. If yes, output Yes; otherwise, output No.

Input Format

One line with one positive integer nn, representing the side length of the square grid.

Output Format

One line with one string, Yes or No.

2
Yes
755689
No

Hint

Sample Explanation

For the first sample, let AA be the square grid. One valid solution is A1,1=1,A1,2=2,A2,1=3,A2,2=4A_{1,1}=1, A_{1,2}=2, A_{2,1}=3, A_{2,2}=4.

For the second sample, it can be proven that there is no solution.

Constraints

This problem uses bundled testdata.

Subtask\text{Subtask} Score nn \le
00 1010
11 2020 10610^6
22 7070 101810^{18}

For all testdata, it is guaranteed that 1n10181 \le n \le 10^{18}.

Translated by ChatGPT 5