{"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\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e疫情封在学校一个月,小明的头发乱糟糟的,于是他想去理发。\u003c/p\u003e\n\u003cp\u003e他当前的头发可以用一个数组a来形容 $$$a_1,a_2,\\ldots, a_n$$$, 其中 $$$a_i$$$ 代表在位置 $$$i$$$ 处的头发长度。 他想要的发型可以用一个数组 $$$b_1,b_2,\\ldots, b_n$$$来描述。\u003c/p\u003e\n\u003cp\u003e理发师有 $$$m$$$ 个剃刀. 每一个剃刀都有它自己的高度并且 \u003cspan class\u003d\"tex-font-style-bf\"\u003e最多\u003c/span\u003e 使用一次. 在每一次操作中,理发师可以选择一个剃刀剃下一段区间的头发。 换言之,一次操作是这样的:\u003c/p\u003e\n\u003cul\u003e\n \u003cli\u003e选择一个没有用过的剃刀,假设它的大小是 $$$x$$$;\u003c/li\u003e\n \u003cli\u003e选择一段区间 $$$[l,r]$$$ ($$$1\\leq l \\leq r \\leq n$$$);\u003c/li\u003e\n \u003cli\u003e对于每一个$$$l\\leq i \\leq r$$$,使得 $$$a_i :\u003d \\min (a_i,x)$$$ ;\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003e注意会有相同大小的剃刀。\u003c/p\u003e\n\u003cp\u003e理发师可以进行任意次数的操作, 只要每个剃刀最多被用了一次 并且对于每一个 $$$1 \\leq i \\leq n$$$ 都有 $$$a_i \u003d b_i$$$. 他 \u003cspan class\u003d\"tex-font-style-bf\"\u003e不必\u003c/span\u003e 使用所有的剃刀.\u003c/p\u003e\n\u003cp\u003e确定理发师是否可以完成小明的发型?\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eEach test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \\leq t \\leq 20\\,000$$$). The description of the test cases follows.\u003c/p\u003e\n\u003cp\u003eThe first line of each test case contains a positive integer $$$n$$$ ($$$3\\leq n\\leq 2\\cdot 10^5$$$)\u0026nbsp;— the length of arrays $$$a$$$ and $$$b$$$.\u003c/p\u003e\n\u003cp\u003eThe second line of each test case contains $$$n$$$ positive integers $$$a_1, a_2, \\ldots, a_n$$$ ($$$1 \\leq a_i \\leq 10^9$$$) \u0026nbsp;— Boris\u0027s current hair.\u003c/p\u003e\n\u003cp\u003eThe third line of each test case contains $$$n$$$ positive integers $$$b_1, b_2, \\ldots, b_n$$$ ($$$1 \\leq b_i \\leq 10^9$$$) \u0026nbsp;— Boris\u0027s desired hair.\u003c/p\u003e\n\u003cp\u003eThe fourth line of each test case contains a positive integer $$$m$$$ ($$$1 \\leq m \\leq 2\\cdot 10^5$$$) \u0026nbsp;— the number of razors.\u003c/p\u003e\n\u003cp\u003eThe fifth line of each test case contains $$$m$$$ positive integers $$$x_1,x_2, \\ldots, x_m$$$ ($$$1 \\leq x_i \\leq 10^9$$$) \u0026nbsp;— the sizes of the razors.\u003c/p\u003e\n\u003cp\u003eIt is guaranteed that the sum of $$$n$$$ and the sum of $$$m$$$ over all test cases do not exceed $$$2\\cdot 10^5$$$.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003e对于每一个test case, 如果理发师可以完成小明想要的发型,print \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eYES\u003c/span\u003e\" ; 否则, print \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eNO\u003c/span\u003e\".\u003c/p\u003e"}},{"title":"Sample 1","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e\n7\n3\n3 3 3\n2 1 2\n2\n1 2\n6\n3 4 4 6 3 4\n3 1 2 3 2 3\n3\n3 2 3\n10\n1 2 3 4 5 6 7 8 9 10\n1 2 3 4 5 6 7 8 9 10\n10\n1 2 3 4 5 6 7 8 9 10\n3\n1 1 1\n1 1 2\n12\n4 2 4 3 1 5 6 3 5 6 2 1\n13\n7 9 4 5 3 3 3 6 8 10 3 2 5\n5 3 1 5 3 2 2 5 8 5 1 1 5\n8\n1 5 3 5 4 2 3 1\n13\n7 9 4 5 3 3 3 6 8 10 3 2 5\n5 3 1 5 3 2 2 5 8 5 1 1 5\n7\n1 5 3 4 2 3 1\n3\n19747843 2736467 938578397\n2039844 2039844 2039844\n1\n2039844\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYES\nNO\nYES\nNO\nYES\nNO\nYES\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eIn the first test case, Boris\u0027s hair is initially $$$[3,3,3]$$$. Let us describe a sequence of $$$2$$$ operations the barber can perform:\u003c/p\u003e\n\u003cul\u003e\n \u003cli\u003eThe barber uses the razor with size $$$1$$$ on the segment $$$[2,2]$$$; hence Boris\u0027s hair becomes $$$[3,1,3]$$$.\u003c/li\u003e\n \u003cli\u003eThe barber uses the razor with size $$$2$$$ on the segment $$$[1,3]$$$; hence Boris\u0027s hair becomes $$$[2,1,2]$$$ which is the desired haircut.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eIn the third test case, no operation has to be done since Boris\u0027s hair is already as desired.\u003c/p\u003e\n\u003cp\u003eIn the fourth test case, no cuts will be able to increase the third element in $$$[1,1,1]$$$ in a way that the array becomes $$$[1,1,2]$$$.\u003c/p\u003e"}}]}