local function reada(n,m)m=m or 1 r={}for i=1,m do r[i]={}end for i=1,n do for j=1,m do r[j][i]=io.read"*n"end end return unpack(r)end
N=io.read"*n"
M=io.read"*n"
H=reada(N)

t={}
for i=1,N do t[i]={}end

for i=1,M do
	a=io.read"*n"
	b=io.read"*n"
	table.insert(t[a],b)
	table.insert(t[b],a)
end
s=0
for i=1,N do
	b=true
	for j=1,#t[i]do
		if(H[t[i][j]]>=H[i])then b=false break end
	end
	if(b)then s=s+1 end
end
print(s)