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

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

AB = []

ans = 0



for i in range(m):

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

    ai = a-1

    bi = b-1

    AB.append([ai,bi])

    AB.append([bi,ai])



AB = sorted(AB)

    

import collections

que = collections.deque()



for i in AB:

    que.append(i)



for i in range(n):

    compare = []

    

    while que:

        if que[0][0] == i:

            ab = que.popleft()

        else:

            break

            

        if ab[0] == i:

            compare.append(H[ab[1]])

    

    c = len(compare)

    

    if c > 0 and H[i] > max(compare):

        ans += 1

    

    if c == 0:

        ans += 1

        

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

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

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



for _ in range(m):

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

    a -= 1

    b -= 1

    edge[a].append(b)

    edge[b].append(a) 



ans = 0



for i in range(n):

    x = edge[i]

    

    if len(x) == 0:

        ans += 1

        continue

        

    highest = 0

    

    for j in x:

        highest = max(highest,H[j])

        

    if H[i] > highest:

        ans += 1

        

print(ans)
n, m = list(map(int, input().split()))
H = list(map(int, input().split()))
AB = []
ans = 0
for i in range(m):
    a, b = list(map(int, input().split()))
    ai = a - 1
    bi = b - 1
    AB.append([ai, bi])
    AB.append([bi, ai])
AB = sorted(AB)
import collections

que = collections.deque()
for i in AB:
    que.append(i)
for i in range(n):
    compare = []
    while que:
        if que[0][0] == i:
            ab = que.popleft()
        else:
            break
        if ab[0] == i:
            compare.append(H[ab[1]])
    c = len(compare)
    if c > 0 and H[i] > max(compare):
        ans += 1
    if c == 0:
        ans += 1
print(ans)

n, m = list(map(int, input().split()))
H = list(map(int, input().split()))
edge = [[] for _ in range(n)]
for _ in range(m):
    a, b = list(map(int, input().split()))
    a -= 1
    b -= 1
    edge[a].append(b)
    edge[b].append(a)
ans = 0
for i in range(n):
    x = edge[i]
    if len(x) == 0:
        ans += 1
        continue
    highest = 0
    for j in x:
        highest = max(highest, H[j])
    if H[i] > highest:
        ans += 1
print(ans)

-AB = [] +edge = [[] for _ in range(n)] +for _ in range(m): +    a, b = list(map(int, input().split())) +    a -= 1 +    b -= 1 +    edge[a].append(b) +    edge[b].append(a) -for i in range(m): -    a, b = list(map(int, input().split())) -    ai = a - 1 -    bi = b - 1 -    AB.append([ai, bi]) -    AB.append([bi, ai]) -AB = sorted(AB) -import collections - -que = collections.deque() -for i in AB: -    que.append(i) -    compare = [] -    while que: -        if que[0][0] == i: -            ab = que.popleft() -        else: -            break -        if ab[0] == i: -            compare.append(H[ab[1]]) -    c = len(compare) -    if c > 0 and H[i] > max(compare): +    x = edge[i] +    if len(x) == 0: -    if c == 0: +        continue +    highest = 0 +    for j in x: +        highest = max(highest, H[j]) +    if H[i] > highest: