{"raw_statement":[{"iden":"statement","content":"Since the giant heads have appeared in the sky all humanity is in danger, so **all** Ricks and Mortys from all parallel universes are gathering in groups to find a solution to get rid of them.\n\nThere are _n_ parallel universes participating in this event (_n_ Ricks and _n_ Mortys). I. e. each of _n_ universes has one Rick and one Morty. They're gathering in _m_ groups. Each person can be in many groups and a group can contain an arbitrary number of members.\n\nRicks and Mortys have registered online in these groups. So, a person can have joined a group more than once (developer of this website hadn't considered this possibility).\n\n<center>![image](https://espresso.codeforces.com/8e28eeaa0567268e4a80f777c0a60c6bc0071709.png)</center>Summer from universe #1 knows that in each parallel universe (including hers) exactly one of Rick and Morty from that universe is a traitor and is loyal, but no one knows which one. She knows that we are doomed if there's a group such that every member in that group is a traitor (they will plan and destroy the world).\n\nSummer knows that if there's a possibility that world ends (there's a group where all members are traitors) she should immediately cancel this event. So she wants to know if she should cancel the event. You have to tell her yes if and only if there's at least one scenario (among all 2_n_ possible scenarios, 2 possible scenarios for who a traitor in each universe) such that in that scenario the world will end."},{"iden":"input","content":"The first line of input contains two integers _n_ and _m_ (1 ≤ _n_, _m_ ≤ 104) — number of universes and number of groups respectively.\n\nThe next _m_ lines contain the information about the groups. _i_\\-th of them first contains an integer _k_ (number of times someone joined _i_\\-th group, _k_ > 0) followed by _k_ integers _v__i_, 1, _v__i_, 2, ..., _v__i_, _k_. If _v__i_, _j_ is negative, it means that Rick from universe number  - _v__i_, _j_ has joined this group and otherwise it means that Morty from universe number _v__i_, _j_ has joined it.\n\nSum of _k_ for all groups does not exceed 104."},{"iden":"output","content":"In a single line print the answer to Summer's question. Print \"_YES_\" if she should cancel the event and \"_NO_\" otherwise."},{"iden":"examples","content":"Input\n\n4 2\n1 -3\n4 -2 3 2 -3\n\nOutput\n\nYES\n\nInput\n\n5 2\n5 3 -2 1 -1 5\n3 -5 2 5\n\nOutput\n\nNO\n\nInput\n\n7 2\n3 -1 6 7\n7 -5 4 2 4 7 -3 4\n\nOutput\n\nYES"},{"iden":"note","content":"In the first sample testcase, 1st group only contains the Rick from universe number 3, so in case he's a traitor, then all members of this group are traitors and so Summer should cancel the event."}],"translated_statement":[{"iden":"statement","content":"自从巨头出现在天空中，全人类都面临危险，因此所有平行宇宙中的所有里克和莫蒂都在集结成群，寻找摆脱它们的方法。\n\n共有 #cf_span[n] 个平行宇宙参与此次活动（#cf_span[n] 个里克和 #cf_span[n] 个莫蒂）。也就是说，每个 #cf_span[n] 个宇宙中各有一个里克和一个莫蒂。他们正在组成 #cf_span[m] 个群体。每个人可以加入多个群体，而一个群体可以包含任意数量的成员。\n\n里克和莫蒂已在线注册加入这些群体。因此，一个人可能多次加入同一个群体（该网站开发者未考虑这种可能性）。\n\n来自第 #1 个宇宙的萨默知道，在每个平行宇宙（包括她自己的）中，里克和莫蒂中恰好有一个是叛徒，另一个是忠诚者，但没有人知道谁是叛徒。她知道，如果存在一个群体，其中所有成员都是叛徒（他们将策划并毁灭世界），那么我们就完了。\n\n萨默知道，如果存在世界毁灭的可能性（即存在一个群体，其中所有成员都是叛徒），她就必须立即取消此次活动。因此，她想知道是否应该取消活动。你必须告诉她“是”，当且仅当至少存在一种可能的情形（在所有 #cf_span[2n] 种可能的情形中，每个宇宙中有 #cf_span[2] 种关于谁是叛徒的选择）使得在该情形下世界将毁灭。\n\n输入的第一行包含两个整数 #cf_span[n] 和 #cf_span[m]（#cf_span[1 ≤ n, m ≤ 10^4]）——分别表示宇宙数量和群体数量。\n\n接下来的 #cf_span[m] 行包含关于各群体的信息。第 #cf_span[i] 行首先包含一个整数 #cf_span[k]（表示有人加入第 #cf_span[i] 个群体的次数，#cf_span[k > 0]），随后是 #cf_span[k] 个整数 #cf_span[vi, 1, vi, 2, ..., vi, k]。如果 #cf_span[vi, j] 为负数，则表示来自宇宙编号 #cf_span[ - vi, j] 的里克加入了该群体；否则，表示来自宇宙编号 #cf_span[vi, j] 的莫蒂加入了该群体。\n\n所有群体的 #cf_span[k] 之和不超过 #cf_span[10^4]。\n\n在一行中输出萨默问题的答案。如果她应该取消活动，则打印 \"_YES_\"，否则打印 \"_NO_\"。\n\n在第一个样例中，第 #1 个群体仅包含来自宇宙编号 #cf_span[3] 的里克，因此如果他是叛徒，则该群体所有成员都是叛徒，萨默应取消活动。"},{"iden":"input","content":"输入的第一行包含两个整数 #cf_span[n] 和 #cf_span[m]（#cf_span[1 ≤ n, m ≤ 10^4]）——分别表示宇宙数量和群体数量。接下来的 #cf_span[m] 行包含关于各群体的信息。第 #cf_span[i] 行首先包含一个整数 #cf_span[k]（表示有人加入第 #cf_span[i] 个群体的次数，#cf_span[k > 0]），随后是 #cf_span[k] 个整数 #cf_span[vi, 1, vi, 2, ..., vi, k]。如果 #cf_span[vi, j] 为负数，则表示来自宇宙编号 #cf_span[ - vi, j] 的里克加入了该群体；否则，表示来自宇宙编号 #cf_span[vi, j] 的莫蒂加入了该群体。所有群体的 #cf_span[k] 之和不超过 #cf_span[10^4]。"},{"iden":"output","content":"在一行中输出萨默问题的答案。如果她应该取消活动，则打印 \"_YES_\"，否则打印 \"_NO_\"。"},{"iden":"examples","content":"输入\n4 2\n1 -3\n4 -2 3 2 -3\n输出\nYES\n\n输入\n5 2\n5 3 -2 1 -1 5\n3 -5 2 5\n输出\nNO\n\n输入\n7 2\n3 -1 6 7\n7 -5 4 2 4 7 -3 4\n输出\nYES"},{"iden":"note","content":"在第一个样例中，第 #1 个群体仅包含来自宇宙编号 #cf_span[3] 的里克，因此如果他是叛徒，则该群体所有成员都是叛徒，萨默应取消活动。"}],"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n, m \\in \\mathbb{Z}^+ $ denote the number of universes and groups, respectively.  \nFor each universe $ i \\in \\{1, \\dots, n\\} $, exactly one of Rick$_i$ or Morty$_i$ is a traitor; let $ t_i \\in \\{ \\text{Rick}, \\text{Morty} \\} $ denote the traitor in universe $ i $.  \nEach group $ j \\in \\{1, \\dots, m\\} $ is a multiset $ G_j \\subseteq (\\{ \\text{Rick}_i, \\text{Morty}_i \\mid i \\in \\{1, \\dots, n\\} \\}) $, where each element is encoded as:  \n- $ v_{j,k} > 0 $ → Morty$_{v_{j,k}} $  \n- $ v_{j,k} < 0 $ → Rick$_{-v_{j,k}} $  \n\n**Constraints**  \n1. $ 1 \\le n, m \\le 10^4 $  \n2. $ \\sum_{j=1}^m |G_j| \\le 10^4 $  \n\n**Objective**  \nDetermine whether there exists **at least one** assignment $ (t_1, \\dots, t_n) \\in \\{ \\text{Rick}_i, \\text{Morty}_i \\}^n $ such that for some group $ j $, every member of $ G_j $ is a traitor.  \n\nThat is, does there exist a traitor assignment where $ \\exists j \\in \\{1, \\dots, m\\} $ such that:  \n$$\n\\forall x \\in G_j,\\ x = t_i \\text{ for the universe } i \\text{ associated with } x?\n$$\n\nOutput \"YES\" if such an assignment exists; otherwise \"NO\".","simple_statement":null,"has_page_source":false}