Codeforces Round 643 (Div. 2)
D
Game With Array
Codeforces
1400
原题
← CE →
翻译中…

Petya and Vasya are competing with each other in a new interesting game as they always do.

翻译中…

At the beginning of the game Petya has to come up with an array of $N$ positive integers. Sum of all elements in his array should be equal to $S$. Then Petya has to select an integer $K$ such that $0 \leq K \leq S$.

翻译中…

In order to win, Vasya has to find a non-empty subarray in Petya's array such that the sum of all selected elements equals to either $K$ or $S - K$. Otherwise Vasya loses.

翻译中…

You are given integers $N$ and $S$. You should determine if Petya can win, considering Vasya plays optimally. If Petya can win, help him to do that.

翻译中…

Input

翻译中…

The first line contains two integers $N$ and $S$ ($1 \leq N \leq S \leq 10^{6}$) — the required length of the array and the required sum of its elements.

翻译中…

Output

翻译中…

If Petya can win, print "YES" (without quotes) in the first line. Then print Petya's array in the second line. The array should contain $N$ positive integers with sum equal to $S$. In the third line print $K$. If there are many correct answers, you can print any of them.

翻译中…

If Petya can't win, print "NO" (without quotes).

翻译中…

You can print each letter in any register (lowercase or uppercase).

翻译中…

样例

Input #1
1 4
Output #1
YES
4
2
InputCopy OutputCopy
Input #2
3 4
Output #2
NO
InputCopy OutputCopy
Input #3
3 8
Output #3
YES
2 1 5
4
InputCopy OutputCopy
题目信息
题号
1355D
时间限制
1 s
内存限制
256 MB
标签
构造
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。