from collections import defaultdict

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

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

ans = N

tog = defaultdict(list)

arr = set()

cnt = 0



for i in range(M):

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

    tog[a].append(H[b-1])

    tog[b].append(H[a-1])

    '''

    if str(a) not in arr:

        ans -= 1

        arr.add(str(H[a-1]))

    if str(b) not in arr:

        ans -= 1

        arr.add(str(H[b-1]))

    '''

#print(tog)



for ele in tog:

    #print(tog[ele])

    #print(max(tog[ele]))

    if H[ele-1] > max(tog[ele]):

        #print('ok')

        cnt += 1



#print(len(tog))

t = N - len(tog)

#print(t)

#print(len(arr))

#print(len(tog)+N-cnt)

print((cnt+t))

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

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

arr = [True for i in range(N)]

ans = 0

for i in range(M):

    A, B = list(map(int, input().split()))

    A -= 1

    B -= 1

    if H[A] <= H[B]:

        arr[A] = False

    if H[B] <= H[A]:

        arr[B] = False

for ele in arr:

    if ele == True:

        ans += 1



print(ans)
from collections import defaultdict

N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
ans = N
tog = defaultdict(list)
arr = set()
cnt = 0
for i in range(M):
    a, b = list(map(int, input().split()))
    tog[a].append(H[b - 1])
    tog[b].append(H[a - 1])
    """
    if str(a) not in arr:
        ans -= 1
        arr.add(str(H[a-1]))
    if str(b) not in arr:
        ans -= 1
        arr.add(str(H[b-1]))
    """
# print(tog)
for ele in tog:
    # print(tog[ele])
    # print(max(tog[ele]))
    if H[ele - 1] > max(tog[ele]):
        # print('ok')
        cnt += 1
# print(len(tog))
t = N - len(tog)
# print(t)
# print(len(arr))
# print(len(tog)+N-cnt)
print((cnt + t))

N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
arr = [True for i in range(N)]
ans = 0
for i in range(M):
    A, B = list(map(int, input().split()))
    A -= 1
    B -= 1
    if H[A] <= H[B]:
        arr[A] = False
    if H[B] <= H[A]:
        arr[B] = False
for ele in arr:
    if ele == True:
        ans += 1
print(ans)

-from collections import defaultdict - -ans = N -tog = defaultdict(list) -arr = set() -cnt = 0 +arr = [True for i in range(N)] +ans = 0 -    a, b = list(map(int, input().split())) -    tog[a].append(H[b - 1]) -    tog[b].append(H[a - 1]) -    """ -    if str(a) not in arr: -        ans -= 1 -        arr.add(str(H[a-1])) -    if str(b) not in arr: -        ans -= 1 -        arr.add(str(H[b-1])) -    """ -# print(tog) -for ele in tog: -    # print(tog[ele]) -    # print(max(tog[ele])) -    if H[ele - 1] > max(tog[ele]): -        # print('ok') -        cnt += 1 -# print(len(tog)) -t = N - len(tog) -# print(t) -# print(len(arr)) -# print(len(tog)+N-cnt) -print((cnt + t)) +    A, B = list(map(int, input().split())) +    A -= 1 +    B -= 1 +    if H[A] <= H[B]: +        arr[A] = False +    if H[B] <= H[A]: +        arr[B] = False +for ele in arr: +    if ele == True: +        ans += 1 +print(ans)