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

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



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

for i in range(m):

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

    a -= 1

    b -= 1

    graph[a].append((H[b], b))

    graph[b].append((H[a], a))



cnt = 0

for i in range(n):

  graph[i].sort(reverse=True)

  if graph[i]:

    if graph[i][0][0] < H[i]:  

      cnt += 1

  else:

    cnt += 1

print(cnt)
def main():

  ## IMPORT MODULE

  #import sys



  #sys.setrecursionlimit(100000)

  #input=lambda :sys.stdin.readline().rstrip()



  #f_inf=float("inf")

  #MOD=10**9+7

  

  if 'get_ipython' in globals(): 

    ## SAMPLE INPUT

    n, m = 4, 3

    H = [1, 2, 3, 4]

    graph = [[(3, 2)], [(3, 2), (4, 3)], [(1, 0), (2, 1)], [(2, 1)]]



  else:

    ##INPUT 

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

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

   

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

    for i in range(m):

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

      a -= 1

      b -= 1

      graph[a].append((H[b], b))

      graph[b].append((H[a], a))



  ## SUBMITION CODES HERE

  cnt = 0

  for i in range(n):

    graph[i].sort(reverse=True)

    if graph[i]:

      if graph[i][0][0] < H[i]:  

        cnt += 1

    else:

      cnt += 1

  print(cnt)

  

main()
n, m = list(map(int, input().split()))
H = list(map(int, input().split()))
graph = [[] for _ in range(n)]
for i in range(m):
    a, b = list(map(int, input().split()))
    a -= 1
    b -= 1
    graph[a].append((H[b], b))
    graph[b].append((H[a], a))
cnt = 0
for i in range(n):
    graph[i].sort(reverse=True)
    if graph[i]:
        if graph[i][0][0] < H[i]:
            cnt += 1
    else:
        cnt += 1
print(cnt)

def main():
    ## IMPORT MODULE
    # import sys
    # sys.setrecursionlimit(100000)
    # input=lambda :sys.stdin.readline().rstrip()
    # f_inf=float("inf")
    # MOD=10**9+7
    if "get_ipython" in globals():
        ## SAMPLE INPUT
        n, m = 4, 3
        H = [1, 2, 3, 4]
        graph = [[(3, 2)], [(3, 2), (4, 3)], [(1, 0), (2, 1)], [(2, 1)]]
    else:
        ##INPUT
        n, m = list(map(int, input().split()))
        H = list(map(int, input().split()))
        graph = [[] for _ in range(n)]
        for i in range(m):
            a, b = list(map(int, input().split()))
            a -= 1
            b -= 1
            graph[a].append((H[b], b))
            graph[b].append((H[a], a))
    ## SUBMITION CODES HERE
    cnt = 0
    for i in range(n):
        graph[i].sort(reverse=True)
        if graph[i]:
            if graph[i][0][0] < H[i]:
                cnt += 1
        else:
            cnt += 1
    print(cnt)


main()

-n, m = list(map(int, input().split())) -H = list(map(int, input().split())) -graph = [[] for _ in range(n)] -for i in range(m): -    a, b = list(map(int, input().split())) -    a -= 1 -    b -= 1 -    graph[a].append((H[b], b)) -    graph[b].append((H[a], a)) -cnt = 0 -for i in range(n): -    graph[i].sort(reverse=True) -    if graph[i]: -        if graph[i][0][0] < H[i]: +def main(): +    ## IMPORT MODULE +    # import sys +    # sys.setrecursionlimit(100000) +    # input=lambda :sys.stdin.readline().rstrip() +    # f_inf=float("inf") +    # MOD=10**9+7 +    if "get_ipython" in globals(): +        ## SAMPLE INPUT +        n, m = 4, 3 +        H = [1, 2, 3, 4] +        graph = [[(3, 2)], [(3, 2), (4, 3)], [(1, 0), (2, 1)], [(2, 1)]] +    else: +        ##INPUT +        n, m = list(map(int, input().split())) +        H = list(map(int, input().split())) +        graph = [[] for _ in range(n)] +        for i in range(m): +            a, b = list(map(int, input().split())) +            a -= 1 +            b -= 1 +            graph[a].append((H[b], b)) +            graph[b].append((H[a], a)) +    ## SUBMITION CODES HERE +    cnt = 0 +    for i in range(n): +        graph[i].sort(reverse=True) +        if graph[i]: +            if graph[i][0][0] < H[i]: +                cnt += 1 +        else: -    else: -        cnt += 1 -print(cnt) +    print(cnt) + + +main()