QOJ.ac

QOJ

时间限制: 1 s 内存限制: 512 MB 总分: 100

#14456. Greatest Common Divisor

统计

If a number $a$ is divisible by a number $b$, then $b$ is called a divisor of $a$. A divisor that is common to two integers is called a common divisor of these two numbers, and the largest of these is called the greatest common divisor. For example, the common divisors of 12 and 16 are 1, 2, and 4, the largest of which is 4; thus, 4 is the greatest common divisor of 12 and 16, generally denoted as $\gcd(12, 16) = 4$.

Now, Xiao C gives you two positive integers $n$ and $k$. Please select exactly $k$ distinct positive integers $x_1, x_2, \dots, x_k$ from $[1, n]$ such that $\gcd(x_i, x_j) = 1$ holds for any pair of integers $(i, j)$ where $1 \le i < j \le k$, or determine that no such solution exists.

Input

A single line containing two positive integers $n, k$ ($2 \le k \le n \le 3 \times 10^5$).

Output

If a feasible solution exists, output two lines. The first line should output YES, and the second line should output $k$ distinct positive integers $x_1, x_2, \dots, x_k$ from $[1, n]$. If there are multiple feasible solutions, output any one of them.

If no feasible solution exists, output a single line NO.

Examples

Input 1

3 3

Output 1

YES
1 2 3

Input 2

4 2

Output 2

YES
1 4

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.