{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"MD","content":"As a noble algorithm inventor, Shankar invented a strange Sorting algorithm. He has an array of **A** of length **n** and **m** positive integers **p\u003csub\u003e1\u003c/sub\u003e**,..., **p\u003csub\u003em\u003c/sub\u003e** of (**1**\u003c\u003d**p**\u003c**n**).He can exchange **A[p\u003csub\u003ei\u003c/sub\u003e]** with **A[p\u003csub\u003ei\u003c/sub\u003e+1]** any number of times. He is confused about whether his algorithm will sort the array correctly in non-decreasing order. Help him figure this out.\n\nExample: \nSay, **A\u003d[3,2,1]** and **p\u003d[1,2]**. Exchange **A[2]** and **A[3]** (as position **2** is in the provided set **p**), to get **A\u003d[3,1,2]**. Then, exchange **A[1]** and **A[2]** (position **1** is in the provided set p) to get **A\u003d[1,3,2]**. Finally, exchange **A[2]** and **A[3]**. Final array is **A\u003d[1, 2,3]**, which sorted in non-decreasing order. \nAlso, if **A\u003d[4,1,2,3]** and **p \u003d[3,2]** , the array **A** is non-sortable.\n\nNote: The examples assume array indexing starting from **1**."}},{"title":"Input","value":{"format":"MD","content":"The first line **T** represents the number of test cases **(T≤100)**\nThe first row of each test case is **n, m (1≤m\u0026ltn≤100)**\nThe **n** integers in the second row are arrays **(1≤A\u003csub\u003ei\u003c/sub\u003e≤100)**\nThe **m** integers in the third line indicate that there are **m** positions that can be exchanged\n\n"}},{"title":"Output","value":{"format":"MD","content":"For each test case, output **YES** if possible, otherwise **NO**."}},{"title":"Example","value":{"format":"MD","content":"\u003cdiv class\u003d\"sample-test\"\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e6\n3 2\n3 2 1\n1 2\n4 2\n4 1 2 3\n3 2\n5 1\n1 2 3 4 5\n1\n4 2\n2 1 4 3\n1 3\n4 2\n4 3 2 1\n1 3\n5 2\n2 1 2 3 3\n1 4\n\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003eYES\nNO\nYES\nYES\nNO\nYES\n\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}}]}