program main
	implicit none
	integer n,m
	integer,allocatable,dimension(:)::d,t
	integer i,j
	allocate(d(n),t(m))
	read(*,*)n
	read(*,*)d(1:n)
	read(*,*)m
	read(*,*)t(1:m)
	do i=1,n
		do j=1,m
		if(t(j)==d(i))t(j)=0
		enddo
	enddo
	do i=1,m
		if(t(i)/=0)then
			write(*,*)"NO"
			goto 10
		endif
	enddo
	write(*,*)"YES"
10 continue	
end program main
