{"raw_statement":[{"iden":"problem statement","content":"Given is a simple undirected graph with $N$ vertices and $M$ edges. The $i$\\-th edge connects Vertex $c_i$ and Vertex $d_i$. Initially, Vertex $i$ has the value $a_i$ written on it. You want to change the values on Vertex $1$, $\\ldots$, Vertex $N$ to $b_1$, $\\cdots$, $b_N$, respectively, by doing the operation below zero or more times.\n\n*   Choose an edge, and let Vertex $x$ and Vertex $y$ be the vertices connected by that edge. Choose one of the following and do it:\n    *   Decrease the value $a_x$ by $1$, and increase the value $a_y$ by $1$.\n    *   Increase the value $a_x$ by $1$, and decrease the value $a_y$ by $1$.\n\nDetermine whether it is possible to achieve the objective by properly doing the operation."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 2 \\times 10^5$\n*   $0 \\leq M \\leq 2 \\times 10^5$\n*   $-10^9 \\leq a_i,b_i \\leq 10^9$\n*   $1 \\leq c_i,d_i \\leq N$\n*   The given graph is simple, that is, has no self-loops and no multi-edges.\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$ $M$\n$a_1$ $\\cdots$ $a_N$\n$b_1$ $\\cdots$ $b_N$\n$c_1$ $d_1$\n$\\vdots$\n$c_M$ $d_M$"},{"iden":"sample input 1","content":"3 2\n1 2 3\n2 2 2\n1 2\n2 3"},{"iden":"sample output 1","content":"Yes\n\nYou can achieve the objective by, for example, doing the operation as follows:\n\n*   In the first operation, choose the edge connecting Vertex $1$ and $2$. Then, increase $a_1$ by $1$ and decrease $a_2$ by $1$.\n*   In the second operation, choose the edge connecting Vertex $2$ and $3$. Then, increase $a_2$ by $1$ and decrease $a_3$ by $1$.\n\nThis sequence of operations makes $a_1=2$, $a_2=2$, and $a_3=2$."},{"iden":"sample input 2","content":"1 0\n5\n5"},{"iden":"sample output 2","content":"Yes\n\nThe objective may be achieved already in the beginning."},{"iden":"sample input 3","content":"2 1\n1 1\n2 1\n1 2"},{"iden":"sample output 3","content":"No\n\nThere is no way to do the operation to achieve the objective."},{"iden":"sample input 4","content":"17 9\n-905371741 -999219903 969314057 -989982132 -87720225 -175700172 -993990465 929461728 895449935 -999016241 782467448 -906404298 578539175 9684413 -619191091 -952046546 125053320\n-440503430 -997661446 -912471383 -995879434 932992245 -928388880 -616761933 929461728 210953513 -994677396 648190629 -530944122 578539175 9684413 595786809 -952046546 125053320\n2 10\n6 12\n9 11\n11 5\n7 6\n3 15\n3 1\n1 9\n10 4"},{"iden":"sample output 4","content":"Yes"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}