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

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



tree=[[0] for i in range(n)]

for i in range(m):

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



  tree[a-1].append(h[b-1])

  tree[b-1].append(h[a-1])



cnt=0

for i in range(n):

  if h[i]>max(tree[i]):

    cnt+=1

print(cnt)
from sys import stdin

nii=lambda:list(map(int,stdin.readline().split()))

lnii=lambda:list(map(int,stdin.readline().split()))



n,m=nii()

h=lnii()



tree=[[] for i in range(n)]

for i in range(m):

  a,b=nii()

  a-=1

  b-=1

  tree[a].append(h[b])

  tree[b].append(h[a])



ans=0

for i in range(n):

  if tree[i]:

    if  h[i]>max(tree[i]):

      ans+=1

  else:

    ans+=1



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

from sys import stdin

nii = lambda: list(map(int, stdin.readline().split()))
lnii = lambda: list(map(int, stdin.readline().split()))
n, m = nii()
h = lnii()
tree = [[] for i in range(n)]
for i in range(m):
    a, b = nii()
    a -= 1
    b -= 1
    tree[a].append(h[b])
    tree[b].append(h[a])
ans = 0
for i in range(n):
    if tree[i]:
        if h[i] > max(tree[i]):
            ans += 1
    else:
        ans += 1
print(ans)

-n, m = list(map(int, input().split())) -h = list(map(int, input().split())) -tree = [[0] for i in range(n)] +from sys import stdin + +nii = lambda: list(map(int, stdin.readline().split())) +lnii = lambda: list(map(int, stdin.readline().split())) +n, m = nii() +h = lnii() +tree = [[] for i in range(n)] -    a, b = list(map(int, input().split())) -    tree[a - 1].append(h[b - 1]) -    tree[b - 1].append(h[a - 1]) -cnt = 0 +    a, b = nii() +    a -= 1 +    b -= 1 +    tree[a].append(h[b]) +    tree[b].append(h[a]) +ans = 0 -    if h[i] > max(tree[i]): -        cnt += 1 -print(cnt) +    if tree[i]: +        if h[i] > max(tree[i]): +            ans += 1 +    else: +        ans += 1 +print(ans)