#P16346. Impossible Problem
Impossible Problem
Background
Source of this problem: https://www.luogu.com.cn/contest/314899.
Problem Description
There is a sequence of length . Each time, you may choose an interval such that the sum of the numbers in this interval is odd, and then add to every number in this interval.
Determine whether it is possible to make all numbers in the sequence equal.
If possible, output Yes; otherwise, output No.
Input Format
This problem has multiple test cases. The first line contains a positive integer .
For each testdata:
- The first line contains a positive integer .
- The second line contains non-negative integers representing the sequence .
Output Format
For each testdata:
- Output one string on a single line representing your answer.
2
2
1 2
2
2 4
Yes
No
Hint
Constraints
For of the data, , , .
| Test Point ID | Score | |
|---|---|---|
Translated by ChatGPT 5