{"trustable":true,"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\u003eBoris thinks that chess is a tedious game. So he left his tournament early and went to a barber shop as his hair was a \u003cspan class\u003d\"tex-font-style-it\"\u003ebit\u003c/span\u003e messy.\u003c/p\u003e\u003cp\u003eHis current hair can be described by an array $$$a_1,a_2,\\ldots, a_n$$$, where $$$a_i$$$ is the height of the hair standing at position $$$i$$$. His desired haircut can be described by an array $$$b_1,b_2,\\ldots, b_n$$$ in a similar fashion.\u003c/p\u003e\u003cp\u003eThe barber has $$$m$$$ razors. Each has its own size and can be used \u003cspan class\u003d\"tex-font-style-bf\"\u003eat most\u003c/span\u003e once. In one operation, he chooses a razor and cuts a segment of Boris\u0027s hair. More formally, an operation is:\u003c/p\u003e\u003cul\u003e \u003cli\u003e Choose any razor which hasn\u0027t been used before, let its size be $$$x$$$; \u003c/li\u003e\u003cli\u003e Choose a segment $$$[l,r]$$$ ($$$1\\leq l \\leq r \\leq n$$$); \u003c/li\u003e\u003cli\u003e Set $$$a_i :\u003d \\min (a_i,x)$$$ for each $$$l\\leq i \\leq r$$$; \u003c/li\u003e\u003c/ul\u003e\u003cp\u003eNotice that some razors might have equal sizes\u0026nbsp;— the barber can choose some size $$$x$$$ only as many times as the number of razors with size $$$x$$$. \u003c/p\u003e\u003cp\u003eHe may perform as many operations as he wants, as long as any razor is used at most once and $$$a_i \u003d b_i$$$ for each $$$1 \\leq i \\leq n$$$ at the end. He \u003cspan class\u003d\"tex-font-style-bf\"\u003edoes not\u003c/span\u003e have to use all razors.\u003c/p\u003e\u003cp\u003eCan you determine whether the barber can give Boris his desired haircut?\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\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\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\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\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\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\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\u003eFor each test case, print \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eYES\u003c/span\u003e\" if the barber can cut Boris\u0027s hair as desired. Otherwise, print \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eNO\u003c/span\u003e\".\u003c/p\u003e\u003cp\u003eYou can output the answer in any case (upper or lower). For example, the strings \"yEs\", \"yes\", \"Yes\", and \"YES\" will be recognized as positive responses.\u003c/p\u003e"}},{"title":"Examples","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\u003e7\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\n\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\u003cul\u003e \u003cli\u003e The barber uses the razor with size $$$1$$$ on the segment $$$[2,2]$$$; hence Boris\u0027s hair becomes $$$[3,1,3]$$$. \u003c/li\u003e\u003cli\u003e The 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\u003c/ul\u003e\u003cp\u003eIn the third test case, no operation has to be done since Boris\u0027s hair is already as desired.\u003c/p\u003e\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"}}]}