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

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



graph=[set() for _ in range(N+1)]

for _ in range(M):

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

  graph[a].add(b)

  graph[b].add(a)

#print(graph)



high_list=[0]*(N+1)

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

  if high_list[i]==-1:

    continue

  

  h=hlist[i-1]

  for s in graph[i]:

    if h<=hlist[s-1]:

      high_list[i]=-1

    if h>=hlist[s-1]:

      high_list[s]=-1 

      

  if high_list[i]==0:

    high_list[i]=1



answer=0

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

  if high_list[i]==1:

    #print(i)

    answer+=1



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

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



graph=[set() for _ in range(N+1)]

for _ in range(M):

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

  graph[a].add(b)

  graph[b].add(a)

#print(graph)



answer=0

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

  h=hlist[i-1]

  for s in graph[i]:

    if h<=hlist[s-1]:

      break

  else:

    answer+=1



print(answer)
N, M = list(map(int, input().split()))
hlist = list(map(int, input().split()))
graph = [set() for _ in range(N + 1)]
for _ in range(M):
    a, b = list(map(int, input().split()))
    graph[a].add(b)
    graph[b].add(a)
# print(graph)
high_list = [0] * (N + 1)
for i in range(1, N + 1):
    if high_list[i] == -1:
        continue
    h = hlist[i - 1]
    for s in graph[i]:
        if h <= hlist[s - 1]:
            high_list[i] = -1
        if h >= hlist[s - 1]:
            high_list[s] = -1
    if high_list[i] == 0:
        high_list[i] = 1
answer = 0
for i in range(1, N + 1):
    if high_list[i] == 1:
        # print(i)
        answer += 1
print(answer)

N, M = list(map(int, input().split()))
hlist = list(map(int, input().split()))
graph = [set() for _ in range(N + 1)]
for _ in range(M):
    a, b = list(map(int, input().split()))
    graph[a].add(b)
    graph[b].add(a)
# print(graph)
answer = 0
for i in range(1, N + 1):
    h = hlist[i - 1]
    for s in graph[i]:
        if h <= hlist[s - 1]:
            break
    else:
        answer += 1
print(answer)

-high_list = [0] * (N + 1) +answer = 0 -    if high_list[i] == -1: -        continue -            high_list[i] = -1 -        if h >= hlist[s - 1]: -            high_list[s] = -1 -    if high_list[i] == 0: -        high_list[i] = 1 -answer = 0 -for i in range(1, N + 1): -    if high_list[i] == 1: -        # print(i) +            break +    else: