{"raw_statement":[{"iden":"problem statement","content":"You are given two sequences, each of length $N$, consisting of integers: $A=(A_1, \\ldots, A_N)$ and $B=(B_1, \\ldots, B_N)$.\nDetermine whether there is a sequence of length $N$, $X=(X_1, \\ldots, X_N)$, satisfying all of the conditions below.\n\n*   $X_i = A_i$ or $X_i = B_i$, for every $i(1\\leq i\\leq N)$.\n    \n*   $|X_i - X_{i+1}| \\leq K$, for every $i(1\\leq i\\leq N-1)$."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 2\\times 10^5$\n*   $0 \\leq K \\leq 10^9$\n*   $1 \\leq A_i,B_i \\leq 10^9$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$ $K$\n$A_1$ $\\ldots$ $A_N$\n$B_1$ $\\ldots$ $B_N$"},{"iden":"sample input 1","content":"5 4\n9 8 3 7 2\n1 6 2 9 5"},{"iden":"sample output 1","content":"Yes\n\n$X=(9,6,3,7,5)$ satisfies all conditions."},{"iden":"sample input 2","content":"4 90\n1 1 1 100\n1 2 3 100"},{"iden":"sample output 2","content":"No\n\nNo $X$ satisfies all conditions."},{"iden":"sample input 3","content":"4 1000000000\n1 1 1000000000 1000000000\n1 1000000000 1 1000000000"},{"iden":"sample output 3","content":"Yes"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}