N,M=list(map(int,input().split()))

H=list(map(int,input().split()))

l=[[]*i for i in range(N)]

for i in range(M):

    A,B=list(map(int,input().split()))

    l[A-1].append(B)

    l[B-1].append(A)

ans=0

for j in range(N):

    if all(H[elem-1]<H[j] for elem in l[j])==True:

        ans+=1

print(ans)















    





    

























N, M = list(map(int, input().split()))

H = list(map(int, input().split()))



A = [0] * N

for i in range(M):

    a, b = list(map(int, input().split()))

    A[a-1] = max(A[a-1], H[b-1])

    A[b-1] = max(A[b-1], H[a-1])



res = sum([H[i] > A[i] for i in range(N)])

print(res)
N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
l = [[] * i for i in range(N)]
for i in range(M):
    A, B = list(map(int, input().split()))
    l[A - 1].append(B)
    l[B - 1].append(A)
ans = 0
for j in range(N):
    if all(H[elem - 1] < H[j] for elem in l[j]) == True:
        ans += 1
print(ans)

N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
A = [0] * N
for i in range(M):
    a, b = list(map(int, input().split()))
    A[a - 1] = max(A[a - 1], H[b - 1])
    A[b - 1] = max(A[b - 1], H[a - 1])
res = sum([H[i] > A[i] for i in range(N)])
print(res)

-l = [[] * i for i in range(N)] +A = [0] * N -    A, B = list(map(int, input().split())) -    l[A - 1].append(B) -    l[B - 1].append(A) -ans = 0 -for j in range(N): -    if all(H[elem - 1] < H[j] for elem in l[j]) == True: -        ans += 1 -print(ans) +    a, b = list(map(int, input().split())) +    A[a - 1] = max(A[a - 1], H[b - 1]) +    A[b - 1] = max(A[b - 1], H[a - 1]) +res = sum([H[i] > A[i] for i in range(N)]) +print(res)