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



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



AB = [tuple(map(int, input().split())) for i in range(M)]



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



for a, b in AB:

  a, b = a-1, b-1

  graph[a].append(b)

  graph[b].append(a)



  ans = 0



for i, h in enumerate(H):

  flag = True

  for to in graph[i]:

    if H[i] > H[to]:

      continue

    else:

      flag = False

    

  if flag:

    ans += 1

  

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



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



#AB = [tuple(map(int, input().split())) for i in range(M)]



#丸暗記。隣接リストの初期化

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



for _ in range(M):

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

  graph[a-1].append(b-1)

  graph[b-1].append(a-1)



  ans = 0



for n in range(N):

  flag = True

  for to in graph[n]:

    if H[n] <= H[to]:

      flag = False

    

  if flag:

    ans += 1

  

print(ans)
N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
AB = [tuple(map(int, input().split())) for i in range(M)]
graph = [[] for _ in range(N)]
for a, b in AB:
    a, b = a - 1, b - 1
    graph[a].append(b)
    graph[b].append(a)
    ans = 0
for i, h in enumerate(H):
    flag = True
    for to in graph[i]:
        if H[i] > H[to]:
            continue
        else:
            flag = False
    if flag:
        ans += 1
print(ans)

N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
# AB = [tuple(map(int, input().split())) for i in range(M)]
# 丸暗記。隣接リストの初期化
graph = [[] for _ in range(N)]
for _ in range(M):
    a, b = list(map(int, input().split()))
    graph[a - 1].append(b - 1)
    graph[b - 1].append(a - 1)
    ans = 0
for n in range(N):
    flag = True
    for to in graph[n]:
        if H[n] <= H[to]:
            flag = False
    if flag:
        ans += 1
print(ans)

-AB = [tuple(map(int, input().split())) for i in range(M)] +# AB = [tuple(map(int, input().split())) for i in range(M)] +# 丸暗記。隣接リストの初期化 -for a, b in AB: -    a, b = a - 1, b - 1 -    graph[a].append(b) -    graph[b].append(a) +for _ in range(M): +    a, b = list(map(int, input().split())) +    graph[a - 1].append(b - 1) +    graph[b - 1].append(a - 1) -for i, h in enumerate(H): +for n in range(N): -    for to in graph[i]: -        if H[i] > H[to]: -            continue -        else: +    for to in graph[n]: +        if H[n] <= H[to]: