local N, M = io.read("*n", "*n")
local hights, is_good = {}, {}
for i = 1, N do
	hights[i] = io.read("*n")
	is_good[i] = true
end

for i = 1, M do
	local A, B = io.read("*n", "*n")

	if is_good[A] and hights[A] <= hights[B] then
		is_good[A] = false
	end
	if is_good[B] and hights[B] <= hights[A] then
		is_good[B] = false
	end
end


local count = 0
for i = 1, N do
	if is_good[i] then
		count = count + 1
	end
	print(is_good[i])
end

print(count)