407795: GYM102894 C Special Christmas Cake

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

C. Special Christmas Caketime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

The family of Diana, a nanotechnologist, is getting ready for Christmas. In order to surprise both of her best friends — Vova and Grisha — she decided to bake a pie, shaped like a $$$n$$$-sided regular polygon.

Suddenly, Diana recalled that Vova enjoys $$$a$$$-sided pies (not necessarily regular), and Grisha enjoys $$$b$$$-sided pies. Is it possible for her to split the pie with a single knife cut into two non-empty parts so that one has exactly $$$a$$$ sides, and the other has exactly $$$b$$$ sides?

Input

The first line contains a single positive integer $$$n$$$ $$$(3 \le n \le 10^9)$$$ — the number of sides in the pie.

The second line contains a single positive integer $$$a$$$ $$$(3 \le a \le 10^9)$$$ — the number of sides that appeals to Vova.

The third line contains a single positive integer $$$b$$$ $$$(3 \le b \le 10^9)$$$ — the number of sides that appeals to Grisha.

Output

Output YES if Diana can split the pie so that both guests will enjoy it, and NO otherwise.

Scoring

PointsLimitsDependenciesGrading policy
118$$$n = 3$$$-complete
222$$$n \le 5$$$1complete
345$$$n \le 100$$$1, 2complete
415$$$n \le 10^9$$$1, 2, 3complete

ExamplesInput
4
3
3
Output
YES
Input
4
4
4
Output
YES
Note

Diana can cut a square pie into two triangular parts by splitting it along the diagonal. The resulting parts won't be regular polygons — in fact, they will be right triangles — but this is not important, according to the statement.

Also, she can cut a square pie into two rectangular ones, splitting it parallel to two of its sides.

加入题单

上一题 下一题 算法标签: