from collections import defaultdict

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

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

dd=defaultdict(set)

for i in range(m):

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

  dd[a-1].add(b-1)

  dd[b-1].add(a-1)

cnt=0

for i,hh in enumerate(h):

  flg=True

  for j in dd[i]:

    if hh <= h[j]:

      flg=False

      break

  if flg:

    cnt+=1

print(cnt)

  

from collections import defaultdict

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

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

ma=[0 for _ in range(n)]

for _ in range(m):

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

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

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

cnt=0

for i,hh in enumerate(ma):

  if h[i] > hh:

    cnt+=1

print(cnt)

  

from collections import defaultdict

n, m = list(map(int, input().split()))
h = list(map(int, input().split()))
dd = defaultdict(set)
for i in range(m):
    a, b = list(map(int, input().split()))
    dd[a - 1].add(b - 1)
    dd[b - 1].add(a - 1)
cnt = 0
for i, hh in enumerate(h):
    flg = True
    for j in dd[i]:
        if hh <= h[j]:
            flg = False
            break
    if flg:
        cnt += 1
print(cnt)

from collections import defaultdict

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

-dd = defaultdict(set) -for i in range(m): +ma = [0 for _ in range(n)] +for _ in range(m): -    dd[a - 1].add(b - 1) -    dd[b - 1].add(a - 1) +    ma[a - 1] = max(ma[a - 1], h[b - 1]) +    ma[b - 1] = max(ma[b - 1], h[a - 1]) -for i, hh in enumerate(h): -    flg = True -    for j in dd[i]: -        if hh <= h[j]: -            flg = False -            break -    if flg: +for i, hh in enumerate(ma): +    if h[i] > hh: