using System; using System.Collections.Generic; using System.Text; using System.Linq; class Program { public void Proc() { Reader.IsDebug = false; int[] inpt = Reader.GetInt(); int blockCount = inpt[0]; int blockLength = inpt[1]; int[] cnt = new int[blockLength + 1]; for(int i=0; i 2) { isYes = false; break; } } if(isYes && blockLength % 2 > 0) { if(val[blockLength / 2] > 1) { isYes = true; } } Console.WriteLine(isYes?"YES":"NO"); } public class Reader { public static bool IsDebug = true; private static String PlainInput = @" 181 2067 595 608 1963 1982 1791 1796 1897 1902 1552 1556 1934 1940 830 844 457 459 2009 2012 1116 1118 447 455 578 578 241 241 1004 1006 1139 1146 659 666 1027 1036 639 655 196 197 399 419 750 752 388 389 717 731 532 548 1050 1054 570 575 1701 1703 135 137 468 476 383 385 289 290 525 539 735 739 444 447 1948 1953 701 705 611 629 1914 1918 1366 1367 267 271 710 715 1988 1988 1269 1285 1667 1676 1571 1578 563 568 1152 1172 1957 1957 1101 1107 307 308 1395 1397 362 363 1507 1510 262 267 1770 1770 1172 1186 1873 1884 915 919 530 531 1743 1744 858 866 693 695 934 945 1468 1476 400 404 490 504 470 477 1747 1750 1538 1542 929 933 1108 1115 336 338 806 832 6 6 1584 1589 1152 1155 1262 1267 23 26 1075 1087 750 778 1336 1346 1739 1743 2059 2059 1324 1329 68 71 1812 1831 1288 1308 821 829 1543 1547 1920 1926 1161 1170 218 224 552 560 209 216 257 261 846 848 1427 1428 422 432 450 455 1783 1787 1479 1485 1063 1067 1022 1026 1733 1742 1947 1947 870 871 1738 1738 177 190 1006 1011 478 484 76 88 745 749 876 876 1599 1600 551 552 1709 1709 1379 1381 278 288 1632 1640 1511 1513 1892 1902 541 543 366 375 1138 1144 1389 1390 779 793 350 355 1103 1113 1937 1941 1363 1368 561 563 1048 1049 1646 1653 1017 1020 1381 1382 1947 1955 1903 1904 73 75 16 17 384 393 2052 2058 1704 1704 692 694 606 610 1483 1485 1705 1711 1800 1824 1433 1441 863 872 680 683 1753 1759 1600 1600 223 226 284 291 1853 1856 965 1003 1760 1761 2022 2037 60 61 380 382 1943 1945 150 159 353 354 407 409 1443 1452 1402 1406 160 163 1211 1212 2038 2045 1146 1148 45 51 2001 2002 1858 1872 655 657 1416 1424 1922 1924 710 717 1690 1690 1254 1258 843 856 1577 1583 "; private static System.IO.StringReader Sr = null; public static string ReadLine() { if (IsDebug) { if (Sr == null) { Sr = new System.IO.StringReader(PlainInput.Trim()); } return Sr.ReadLine(); } else { return Console.ReadLine(); } } public static int[] GetInt(char delimiter = ' ', bool trim = false) { string inptStr = ReadLine(); if (trim) { inptStr = inptStr.Trim(); } string[] inpt = inptStr.Split(delimiter); int[] ret = new int[inpt.Length]; for (int i = 0; i < inpt.Length; i++) { ret[i] = int.Parse(inpt[i]); } return ret; } } static void Main() { Program prg = new Program(); prg.Proc(); } }