{"problem":{"name":"A. Odds and Ends","description":{"content":"_Where do odds begin, and where do they end? Where does hope emerge, and will they ever break?_ Given an integer sequence _a_1, _a_2, ..., _a__n_ of length _n_. Decide whether it is possible to divid","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF849A"},"statements":[{"statement_type":"Markdown","content":"_Where do odds begin, and where do they end? Where does hope emerge, and will they ever break?_\n\nGiven an integer sequence _a_1, _a_2, ..., _a__n_ of length _n_. Decide whether it is possible to divide it into an odd number of non-empty subsegments, the each of which has an odd length and begins and ends with odd numbers.\n\nA subsegment is a contiguous slice of the whole sequence. For example, {3, 4, 5} and {1} are subsegments of sequence {1, 2, 3, 4, 5, 6}, while {1, 2, 4} and {7} are not.\n\n## Input\n\nThe first line of input contains a non-negative integer _n_ (1 ≤ _n_ ≤ 100) — the length of the sequence.\n\nThe second line contains _n_ space-separated non-negative integers _a_1, _a_2, ..., _a__n_ (0 ≤ _a__i_ ≤ 100) — the elements of the sequence.\n\n## Output\n\nOutput \"_Yes_\" if it's possible to fulfill the requirements, and \"_No_\" otherwise.\n\nYou can output each letter in any case (upper or lower).\n\n[samples]\n\n## Note\n\nIn the first example, divide the sequence into 1 subsegment: {1, 3, 5} and the requirements will be met.\n\nIn the second example, divide the sequence into 3 subsegments: {1, 0, 1}, {5}, {1}.\n\nIn the third example, one of the subsegments must start with 4 which is an even number, thus the requirements cannot be met.\n\nIn the fourth example, the sequence can be divided into 2 subsegments: {3, 9, 9}, {3}, but this is not a valid solution because 2 is an even number.","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"_Where do odds begin, and where do they end? Where does hope emerge, and will they ever break?_\n\n给定一个长度为 #cf_span[n] 的整数序列 #cf_span[a1, a2, ..., an]。判断是否能将其划分为奇数个非空子段，使得每个子段的长度为奇数，且首尾元素均为奇数。\n\n#cf_span(class=[tex-font-style-underline], body=[subsegment]) 是整个序列的一个连续子序列。例如，#cf_span[{3, 4, 5}] 和 #cf_span[{1}] 是序列 #cf_span[{1, 2, 3, 4, 5, 6}] 的子段，而 #cf_span[{1, 2, 4}] 和 #cf_span[{7}] 则不是。\n\n输入的第一行包含一个非负整数 #cf_span[n] (#cf_span[1 ≤ n ≤ 100]) —— 序列的长度。\n\n第二行包含 #cf_span[n] 个用空格分隔的非负整数 #cf_span[a1, a2, ..., an] (#cf_span[0 ≤ ai ≤ 100]) —— 序列的元素。\n\n如果能满足要求，输出 \"_Yes_\"；否则输出 \"_No_\"。\n\n你可以以任意大小写输出每个字母。\n\n在第一个例子中，将序列划分为 #cf_span[1] 个子段：#cf_span[{1, 3, 5}]，即可满足要求。\n\n在第二个例子中，将序列划分为 #cf_span[3] 个子段：#cf_span[{1, 0, 1}]、#cf_span[{5}]、#cf_span[{1}]。\n\n在第三个例子中，某个子段必须以 #cf_span[4] 开头，而 4 是偶数，因此无法满足要求。\n\n在第四个例子中，序列可以划分为 #cf_span[2] 个子段：#cf_span[{3, 9, 9}]、#cf_span[{3}]，但这不是合法解，因为 #cf_span[2] 是偶数。\n\n## Input\n\n输入的第一行包含一个非负整数 #cf_span[n] (#cf_span[1 ≤ n ≤ 100]) —— 序列的长度。第二行包含 #cf_span[n] 个用空格分隔的非负整数 #cf_span[a1, a2, ..., an] (#cf_span[0 ≤ ai ≤ 100]) —— 序列的元素。\n\n## Output\n\n如果能满足要求，输出 \"_Yes_\"；否则输出 \"_No_\"。你可以以任意大小写输出每个字母。\n\n[samples]\n\n## Note\n\n在第一个例子中，将序列划分为 #cf_span[1] 个子段：#cf_span[{1, 3, 5}]，即可满足要求。在第二个例子中，将序列划分为 #cf_span[3] 个子段：#cf_span[{1, 0, 1}]、#cf_span[{5}]、#cf_span[{1}]。在第三个例子中，某个子段必须以 #cf_span[4] 开头，而 4 是偶数，因此无法满足要求。在第四个例子中，序列可以划分为 #cf_span[2] 个子段：#cf_span[{3, 9, 9}]、#cf_span[{3}]，但这不是合法解，因为 #cf_span[2] 是偶数。","is_translate":true,"language":"Chinese"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ n \\in \\mathbb{Z}_{\\geq 0} $ be the length of the sequence.  \nLet $ A = (a_1, a_2, \\dots, a_n) $ be a sequence of non-negative integers.\n\nA *subsegment* is a contiguous subsequence $ (a_i, a_{i+1}, \\dots, a_j) $ for some $ 1 \\leq i \\leq j \\leq n $.  \nA subsegment is *valid* if:  \n- Its length $ j - i + 1 $ is odd,  \n- Both endpoints $ a_i $ and $ a_j $ are odd.\n\n**Constraints**  \n1. $ 1 \\leq n \\leq 100 $  \n2. $ 0 \\leq a_i \\leq 100 $ for all $ i \\in \\{1, \\dots, n\\} $\n\n**Objective**  \nDetermine whether there exists a partition of $ A $ into $ k $ non-overlapping, contiguous, valid subsegments, such that:  \n- $ k $ is an odd positive integer,  \n- Every element of $ A $ belongs to exactly one subsegment.\n\nOutput \"Yes\" if such a partition exists; otherwise, output \"No\".","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF849A","tags":["implementation"],"sample_group":[["3\n1 3 5","Yes"],["5\n1 0 1 5 1","Yes"],["3\n4 3 1","No"],["4\n3 9 9 3","No"]],"created_at":"2026-03-03 11:00:39"}}