#P5497. [LnOI2019SP] 龟速单项式变换(SMT)

[LnOI2019SP] 龟速单项式变换(SMT)

Description

The following definition is given: if, in a positive integer sequence aa, there exists a sum of several consecutive positive integers that is a multiple of mm, then the positive integer sequence aa is called an “mm sequence”.

Given nn and mm, you need to determine whether every positive integer sequence aa of length nn is an “mm sequence”.

Input Format

Two numbers, nn and mm.

Output Format

If it holds, output YES; otherwise output NO.

2 4

NO

Hint

Sample explanation: there exists a counterexample [1,2][1, 2].

Subtask 1 (50 pts): 1n,m51 \le n, m \le 5.

Subtask 2 (50 pts): 1n,m10181 \le n, m \le {10}^{18}.

Translated by ChatGPT 5