import heapq



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

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



d={i:[0] for i in range(1,N+1)}



for _ in range(M):

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

    d[a].append(-(H[b-1]))

    d[b].append(-(H[a-1]))



ans=0

for i in range(1,N+1):

    hq=d[i]

    heapq.heapify(hq)

    s=heapq.heappop(hq)

    if (-s)<H[i-1]:

        ans+=1



print(ans)

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

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

L=[0]*(N+1)

for i in range(M):

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

    if H[a-1]>H[b-1]:

        L[b]=1

    elif H[a-1]<H[b-1]:

        L[a]=1

    else:

        L[a],L[b]=1,1

print((N-sum(L)))

import heapq

N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
d = {i: [0] for i in range(1, N + 1)}
for _ in range(M):
    a, b = list(map(int, input().split()))
    d[a].append(-(H[b - 1]))
    d[b].append(-(H[a - 1]))
ans = 0
for i in range(1, N + 1):
    hq = d[i]
    heapq.heapify(hq)
    s = heapq.heappop(hq)
    if (-s) < H[i - 1]:
        ans += 1
print(ans)

N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
L = [0] * (N + 1)
for i in range(M):
    a, b = list(map(int, input().split()))
    if H[a - 1] > H[b - 1]:
        L[b] = 1
    elif H[a - 1] < H[b - 1]:
        L[a] = 1
    else:
        L[a], L[b] = 1, 1
print((N - sum(L)))

-import heapq - -d = {i: [0] for i in range(1, N + 1)} -for _ in range(M): +L = [0] * (N + 1) +for i in range(M): -    d[a].append(-(H[b - 1])) -    d[b].append(-(H[a - 1])) -ans = 0 -for i in range(1, N + 1): -    hq = d[i] -    heapq.heapify(hq) -    s = heapq.heappop(hq) -    if (-s) < H[i - 1]: -        ans += 1 -print(ans) +    if H[a - 1] > H[b - 1]: +        L[b] = 1 +    elif H[a - 1] < H[b - 1]: +        L[a] = 1 +    else: +        L[a], L[b] = 1, 1 +print((N - sum(L)))