Zipline Bonanza

View as PDF

Submit solution

Points: 5
Time limit: 1.0s
Memory limit: 64M

Author:
Problem types

Rachel was looking at the ziplines in Globgalab city, when she got an idea.

Each zipline pole has two levels, a top and bottom layer, in order to reduce zipline traffic. The bottom layer always connects to the bottom layer of another pole and the top layer always connects to another top layer. The connecting wire is set up so that the two layers are always symmetrical. If there is connection in the top layer from pole i to pole j, there will be a connection the bottom layer from pole i to j and vice versa.

Rachel decides to call this structure a stacked graph. A stacked graph, similar to the ziplines, will consist of two symmetrical, connected graphs that are stacked on top of each other. The graphs will then be connected vertically to represent the poles which connect corresponding top and bottom layers. Additionally, there can be at most one edge between any two nodes in the stacked graph, that is to say, there cannot be any duplicate edges.

Rachel wants to figure out if she can make a stacked graph with exactly N nodes and M edges. Can you help her?

Input Specification

The first and only line of input will consist of two integers N and M, the number of nodes and edges respectively N, M (1 \le N \le 2 \cdot 10^5, 1 \le M \le 2 \cdot 10^5)

Output Specification

Output YEP if she can make a stacked graph otherwise output NOP.

Subtasks

Subtask 1 (10%)

N \le 8

Subtask 2 (90%)

No further constraints.

Sample Input

3 4

Sample Output

NOP

Comments

There are no comments at the moment.