There is a right triangle with legs of length *a* and *b*. Your task is to determine whether it is possible to locate the triangle on the plane in such a way that none of its sides is parallel to the coordinate axes. All the vertices must have integer coordinates. If there exists such a location, you have to output the appropriate coordinates of vertices.
The first line contains two integers *a*, *b* (1 ≤ *a*, *b* ≤ 1000), separated by a single space.
pairs = {5: (4, 3), 10: (8, 6), 13: (12, 5), 15: (12, 9), 17: (15, 8), 20: (16, 12), 25: (24, 7), 26: (24, 10), 29: (21, 20), 30: (24, 18), 34: (30, 16), 35: (28, 21), 37: (35, 12), 39: (36, 15), 40: (32, 24), 41: (40, 9), 45: (36, 27), 50: (48, 14), 51: (45, 24), 52: (48, 20), 53: (45, 28), 55: (44, 33), 58: (42, 40), 60: (48, 36), 61: (60, 11), 65: (63, 16), 68: (60, 32), 70: (56, 42), 73: (55, 48), 74: (70, 24), 75: (72, 21), 78: (72, 30), 80: (64, 48), 82: (80, 18), 85: (84, 13), 87: (63, 60), 89: (80, 39), 90: (72, 54), 91: (84, 35), 95: (76, 57), 97: (72, 65), 100: (96, 28), 101: (99, 20), 102: (90, 48), 104: (96, 40), 105: (84, 63), 106: (90, 56), 109: (91, 60), 110: (88, 66), 111: (105, 36), 113: (112, 15), 115: (92, 69), 116: (84, 80), 117: (108, 45), 119: (105, 56), 120: (96, 72), 122: (120, 22), 123: (120, 27), 125: (120, 35), 130: (126, 32), 135: (108, 81), 136: (120, 64), 137: (105, 88), 140: (112, 84), 143: (132, 55), 145: (144, 17), 146: (110, 96), 148: (140, 48), 149: (140, 51), 150: (144, 42), 153: (135, 72), 155: (124, 93), 156: (144, 60), 157: (132, 85), 159: (135, 84), 160: (128, 96), 164: (160, 36), 165: (132, 99), 169: (156, 65), 170: (168, 26), 173: (165, 52), 174: (126, 120), 175: (168, 49), 178: (160, 78), 180: (144, 108), 181: (180, 19), 182: (168, 70), 183: (180, 33), 185: (176, 57), 187: (165, 88), 190: (152, 114), 193: (168, 95), 194: (144, 130), 195: (189, 48), 197: (195, 28), 200: (192, 56), 202: (198, 40), 203: (147, 140), 204: (180, 96), 205: (200, 45), 208: (192, 80), 210: (168, 126), 212: (180, 112), 215: (172, 129), 218: (182, 120), 219: (165, 144), 220: (176, 132), 221: (220, 21), 222: (210, 72), 225: (216, 63), 226: (224, 30), 229: (221, 60), 230: (184, 138), 232: (168, 160), 233: (208, 105), 234: (216, 90), 235: (188, 141), 238: (210, 112), 240: (192, 144), 241: (209, 120), 244: (240, 44), 245: (196, 147), 246: (240, 54), 247: (228, 95), 250: (240, 70), 255: (252, 39), 257: (255, 32), 259: (245, 84), 260: (252, 64), 261: (189, 180), 265: (264, 23), 267: (240, 117), 269: (260, 69), 270: (216, 162), 272: (240, 128), 273: (252, 105), 274: (210, 176), 275: (264, 77), 277: (252, 115), 280: (224, 168), 281: (231, 160), 285: (228, 171), 286: (264, 110), 287: (280, 63), 289: (255, 136), 290: (288, 34), 291: (216, 195), 292: (220, 192), 293: (285, 68), 295: (236, 177), 296: (280, 96), 298: (280, 102), 299: (276, 115), 300: (288, 84), 303: (297, 60), 305: (300, 55), 306: (270, 144), 310: (248, 186), 312: (288, 120), 313: (312, 25), 314: (264, 170), 315: (252, 189), 317: (308, 75), 318: (270, 168), 319: (231, 220), 320: (256, 192), 323: (285, 152), 325: (323, 36), 327: (273, 180), 328: (320, 72), 330: (264, 198), 333: (315, 108), 335: (268, 201), 337: (288, 175), 338: (312, 130), 339: (336, 45), 340: (336, 52), 345: (276, 207), 346: (330, 104), 348: (252, 240), 349: (299, 180), 350: (336, 98), 351: (324, 135), 353: (272, 225), 355: (284, 213), 356: (320, 156), 357: (315, 168), 360: (288, 216), 362: (360, 38), 364: (336, 140), 365: (364, 27), 366: (360, 66), 369: (360, 81), 370: (352, 114), 371: (315, 196), 373: (275, 252), 374: (330, 176), 375: (360, 105), 377: (352, 135), 380: (304, 228), 385: (308, 231), 386: (336, 190), 388: (288, 260), 389: (340, 189), 390: (378, 96), 391: (345, 184), 394: (390, 56), 395: (316, 237), 397: (325, 228), 400: (384, 112), 401: (399, 40), 403: (372, 155), 404: (396, 80), 405: (324, 243), 406: (294, 280), 407: (385, 132), 408: (360, 192), 409: (391, 120), 410: (400, 90), 411: (315, 264), 415: (332, 249), 416: (384, 160), 420: (336, 252), 421: (420, 29), 424: (360, 224), 425: (420, 65), 427: (420, 77), 429: (396, 165), 430: (344, 258), 433: (408, 145), 435: (432, 51), 436: (364, 240), 438: (330, 288), 440: (352, 264), 442: (440, 42), 444: (420, 144), 445: (437, 84), 447: (420, 153), 449: (351, 280), 450: (432, 126), 451: (440, 99), 452: (448, 60), 455: (441, 112), 457: (425, 168), 458: (442, 120), 459: (405, 216), 460: (368, 276), 461: (380, 261), 464: (336, 320), 465: (372, 279), 466: (416, 210), 468: (432, 180), 470: (376, 282), 471: (396, 255), 475: (456, 133), 476: (420, 224), 477: (405, 252), 480: (384, 288), 481: (480, 31), 482: (418, 240), 485: (483, 44), 488: (480, 88), 490: (392, 294), 492: (480, 108), 493: (475, 132), 494: (456, 190), 495: (396, 297), 500: (480, 140), 505: (495, 100), 507: (468, 195), 509: (459, 220), 510: (504, 78), 511: (385, 336), 514: (510, 64), 515: (412, 309), 518: (490, 168), 519: (495, 156), 520: (504, 128), 521: (440, 279), 522: (378, 360), 525: (504, 147), 527: (465, 248), 530: (528, 46), 533: (525, 92), 534: (480, 234), 535: (428, 321), 538: (520, 138), 540: (432, 324), 541: (420, 341), 543: (540, 57), 544: (480, 256), 545: (544, 33), 546: (504, 210), 548: (420, 352), 549: (540, 99), 550: (528, 154), 551: (399, 380), 554: (504, 230), 555: (528, 171), 557: (532, 165), 559: (516, 215), 560: (448, 336), 561: (495, 264), 562: (462, 320), 565: (560, 75), 569: (520, 231), 570: (456, 342), 572: (528, 220), 574: (560, 126), 575: (552, 161), 577: (575, 48), 578: (510, 272), 579: (504, 285), 580: (576, 68), 582: (432, 390), 583: (495, 308), 584: (440, 384), 585: (567, 144), 586: (570, 136), 590: (472, 354), 591: (585, 84), 592: (560, 192), 593: (465, 368), 595: (588, 91), 596: (560, 204), 598: (552, 230), 600: (576, 168), 601: (551, 240), 605: (484, 363), 606: (594, 120), 609: (441, 420), 610: (600, 110), 611: (564, 235), 612: (540, 288), 613: (612, 35), 615: (600, 135), 617: (608, 105), 620: (496, 372), 623: (560, 273), 624: (576, 240), 625: (600, 175), 626: (624, 50), 628: (528, 340), 629: (621, 100), 630: (504, 378), 634: (616, 150), 635: (508, 381), 636: (540, 336), 637: (588, 245), 638: (462, 440), 640: (512, 384), 641: (609, 200), 645: (516, 387), 646: (570, 304), 650: (646, 72), 653: (572, 315), 654: (546, 360), 655: (524, 393), 656: (640, 144), 657: (495, 432), 660: (528, 396), 661: (589, 300), 663: (660, 63), 665: (532, 399), 666: (630, 216), 667: (483, 460), 670: (536, 402), 671: (660, 121), 673: (552, 385), 674: (576, 350), 675: (648, 189), 676: (624, 260), 677: (675, 52), 678: (672, 90), 679: (504, 455), 680: (672, 104), 685: (684, 37), 687: (663, 180), 689: (680, 111), 690: (552, 414), 692: (660, 208), 695: (556, 417), 696: (504, 480), 697: (680, 153), 698: (598, 360), 699: (624, 315), 700: (672, 196), 701: (651, 260), 702: (648, 270), 703: (665, 228), 705: (564, 423), 706: (544, 450), 707: (693, 140), 709: (660, 259), 710: (568, 426), 712: (640, 312), 714: (630, 336), 715: (693, 176), 720: (576, 432), 723: (627, 360), 724: (720, 76), 725: (720, 85), 728: (672, 280), 730: (728, 54), 731: (645, 344), 732: (720, 132), 733: (725, 108), 735: (588, 441), 738: (720, 162), 740: (704, 228), 741: (684, 285), 742: (630, 392), 745: (713, 216), 746: (550, 504), 748: (660, 352), 750: (720, 210), 754: (704, 270), 755: (604, 453), 757: (595, 468), 760: (608, 456), 761: (760, 39), 763: (637, 420), 765: (756, 117), 767: (708, 295), 769: (600, 481), 770: (616, 462), 771: (765, 96), 772: (672, 380), 773: (748, 195), 775: (744, 217), 776: (576, 520), 777: (735, 252), 778: (680, 378), 779: (760, 171), 780: (756, 192), 782: (690, 368), 783: (567, 540), 785: (783, 56), 788: (780, 112), 790: (632, 474), 791: (784, 105), 793: (780, 143), 794: (650, 456), 795: (792, 69), 797: (572, 555), 799: (705, 376), 800: (768, 224), 801: (720, 351), 802: (798, 80), 803: (605, 528), 805: (644, 483), 806: (744, 310), 807: (780, 207), 808: (792, 160), 809: (759, 280), 810: (648, 486), 812: (588, 560), 814: (770, 264), 815: (652, 489), 816: (720, 384), 818: (782, 240), 819: (756, 315), 820: (800, 180), 821: (700, 429), 822: (630, 528), 825: (792, 231), 829: (629, 540), 830: (664, 498), 831: (756, 345), 832: (768, 320), 833: (735, 392), 835: (668, 501), 840: (672, 504), 841: (840, 41), 842: (840, 58), 843: (693, 480), 845: (837, 116), 848: (720, 448), 850: (840, 130), 851: (805, 276), 853: (828, 205), 854: (840, 154), 855: (684, 513), 857: (825, 232), 858: (792, 330), 860: (688, 516), 861: (840, 189), 865: (825, 260), 866: (816, 290), 867: (765, 408), 870: (864, 102), 871: (804, 335), 872: (728, 480), 873: (648, 585), 875: (840, 245), 876: (660, 576), 877: (805, 348), 879: (855, 204), 880: (704, 528), 881: (800, 369), 884: (880, 84), 885: (708, 531), 888: (840, 288), 890: (874, 168), 894: (840, 306), 895: (716, 537), 897: (828, 345), 898: (702, 560), 899: (651, 620), 900: (864, 252), 901: (899, 60), 902: (880, 198), 904: (896, 120), 905: (900, 95), 909: (891, 180), 910: (882, 224), 914: (850, 336), 915: (900, 165), 916: (884, 240), 918: (810, 432), 920: (736, 552), 922: (760, 522), 923: (852, 355), 925: (924, 43), 928: (672, 640), 929: (920, 129), 930: (744, 558), 932: (832, 420), 935: (924, 143), 936: (864, 360), 937: (912, 215), 939: (936, 75), 940: (752, 564), 941: (741, 580), 942: (792, 510), 943: (920, 207), 945: (756, 567), 949: (900, 301), 950: (912, 266), 951: (924, 225), 952: (840, 448), 953: (728, 615), 954: (810, 504), 955: (764, 573), 957: (693, 660), 959: (735, 616), 960: (768, 576), 962: (960, 62), 964: (836, 480), 965: (957, 124), 969: (855, 456), 970: (966, 88), 975: (969, 108), 976: (960, 176), 977: (945, 248), 979: (880, 429), 980: (784, 588), 981: (819, 540), 984: (960, 216), 985: (975, 140), 986: (950, 264), 988: (912, 380), 990: (792, 594), 995: (796, 597), 997: (925, 372), 999: (945, 324), 1000: (960, 280)}
available = [5, 10, 13, 15, 17, 20, 25, 26, 29, 30, 34, 35, 37, 39, 40, 41, 45, 50, 51, 52, 53, 55, 58, 60, 61, 65, 68, 70, 73, 74, 75, 78, 80, 82, 85, 87, 89, 90, 91, 95, 97, 100, 101, 102, 104, 105, 106, 109, 110, 111, 113, 115, 116, 117, 119, 120, 122, 123, 125, 130, 135, 136, 137, 140, 143, 145, 146, 148, 149, 150, 153, 155, 156, 157, 159, 160, 164, 165, 169, 170, 173, 174, 175, 178, 180, 181, 182, 183, 185, 187, 190, 193, 194, 195, 197, 200, 202, 203, 204, 205, 208, 210, 212, 215, 218, 219, 220, 221, 222, 225, 226, 229, 230, 232, 233, 234, 235, 238, 240, 241, 244, 245, 246, 247, 250, 255, 257, 259, 260, 261, 265, 267, 269, 270, 272, 273, 274, 275, 277, 280, 281, 285, 286, 287, 289, 290, 291, 292, 293, 295, 296, 298, 299, 300, 303, 305, 306, 310, 312, 313, 314, 315, 317, 318, 319, 320, 323, 325, 327, 328, 330, 333, 335, 337, 338, 339, 340, 345, 346, 348, 349, 350, 351, 353, 355, 356, 357, 360, 362, 364, 365, 366, 369, 370, 371, 373, 374, 375, 377, 380, 385, 386, 388, 389, 390, 391, 394, 395, 397, 400, 401, 403, 404, 405, 406, 407, 408, 409, 410, 411, 415, 416, 420, 421, 424, 425, 427, 429, 430, 433, 435, 436, 438, 440, 442, 444, 445, 447, 449, 450, 451, 452, 455, 457, 458, 459, 460, 461, 464, 465, 466, 468, 470, 471, 475, 476, 477, 480, 481, 482, 485, 488, 490, 492, 493, 494, 495, 500, 505, 507, 509, 510, 511, 514, 515, 518, 519, 520, 521, 522, 525, 527, 530, 533, 534, 535, 538, 540, 541, 543, 544, 545, 546, 548, 549, 550, 551, 554, 555, 557, 559, 560, 561, 562, 565, 569, 570, 572, 574, 575, 577, 578, 579, 580, 582, 583, 584, 585, 586, 590, 591, 592, 593, 595, 596, 598, 600, 601, 605, 606, 609, 610, 611, 612, 613, 615, 617, 620, 623, 624, 625, 626, 628, 629, 630, 634, 635, 636, 637, 638, 640, 641, 645, 646, 650, 653, 654, 655, 656, 657, 660, 661, 663, 665, 666, 667, 670, 671, 673, 674, 675, 676, 677, 678, 679, 680, 685, 687, 689, 690, 692, 695, 696, 697, 698, 699, 700, 701, 702, 703, 705, 706, 707, 709, 710, 712, 714, 715, 720, 723, 724, 725, 728, 730, 731, 732, 733, 735, 738, 740, 741, 742, 745, 746, 748, 750, 754, 755, 757, 760, 761, 763, 765, 767, 769, 770, 771, 772, 773, 775, 776, 777, 778, 779, 780, 782, 783, 785, 788, 790, 791, 793, 794, 795, 797, 799, 800, 801, 802, 803, 805, 806, 807, 808, 809, 810, 812, 814, 815, 816, 818, 819, 820, 821, 822, 825, 829, 830, 831, 832, 833, 835, 840, 841, 842, 843, 845, 848, 850, 851, 853, 854, 855, 857, 858, 860, 861, 865, 866, 867, 870, 871, 872, 873, 875, 876, 877, 879, 880, 881, 884, 885, 888, 890, 894, 895, 897, 898, 899, 900, 901, 902, 904, 905, 909, 910, 914, 915, 916, 918, 920, 922, 923, 925, 928, 929, 930, 932, 935, 936, 937, 939, 940, 941, 942, 943, 945, 949, 950, 951, 952, 953, 954, 955, 957, 959, 960, 962, 964, 965, 969, 970, 975, 976, 977, 979, 980, 981, 984, 985, 986, 988, 990, 995, 997, 999, 1000]

a, b = [int(c) for c in input().split()]

if a in available and b in available and max(a,b) % min(a,b) == 0:
    print('YES')
    print('0 0')
    a1 = pairs[a]
    b1 = pairs[b]
    print(' '.join(map(str, a1)))
    if a1[1] != b1[0]:
        print(0 - b1[1], b1[0])
    else:
        print(b1[1], 0 - b1[0])

else:
    print('NO')