import numpy as np

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

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



adj = [[] for _ in range(N)]



for _ in range(M):

    a,b = [int(x) -1 for x in input().split()]

    if a in adj[b]:

        continue

    adj[a].append(b)

    adj[b].append(a)



ans = 0 

for i, item in enumerate(adj):

     if item == []:

         ans+=1

         continue

     adj_max = max(H[item])

     if H[i] > adj_max:

         ans += 1

print(ans)
n,m = list(map(int,input().split()))

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

ma = [0]*(n)

for i in range(m):

  a,b = [int(x)-1 for x in input().split()]

  ma[a] = max(ma[a], h[b])

  ma[b] = max(h[a], ma[b])

ans = 0

for i in range(n):

  if h[i]>ma[i]:

    ans+=1

print(ans)

import numpy as np

N, M = list(map(int, input().split()))
H = np.array(list(map(int, input().split())))
adj = [[] for _ in range(N)]
for _ in range(M):
    a, b = [int(x) - 1 for x in input().split()]
    if a in adj[b]:
        continue
    adj[a].append(b)
    adj[b].append(a)
ans = 0
for i, item in enumerate(adj):
    if item == []:
        ans += 1
        continue
    adj_max = max(H[item])
    if H[i] > adj_max:
        ans += 1
print(ans)

n, m = list(map(int, input().split()))
h = list(map(int, input().split()))
ma = [0] * (n)
for i in range(m):
    a, b = [int(x) - 1 for x in input().split()]
    ma[a] = max(ma[a], h[b])
    ma[b] = max(h[a], ma[b])
ans = 0
for i in range(n):
    if h[i] > ma[i]:
        ans += 1
print(ans)

-import numpy as np - -N, M = list(map(int, input().split())) -H = np.array(list(map(int, input().split()))) -adj = [[] for _ in range(N)] -for _ in range(M): +n, m = list(map(int, input().split())) +h = list(map(int, input().split())) +ma = [0] * (n) +for i in range(m): -    if a in adj[b]: -        continue -    adj[a].append(b) -    adj[b].append(a) +    ma[a] = max(ma[a], h[b]) +    ma[b] = max(h[a], ma[b]) -for i, item in enumerate(adj): -    if item == []: -        ans += 1 -        continue -    adj_max = max(H[item]) -    if H[i] > adj_max: +for i in range(n): +    if h[i] > ma[i]: