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

p_list = [1 for _ in range(N)]

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

for _ in range(M):

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

   if e_list[a - 1] <= e_list[b - 1]:

       p_list[a - 1] = 0

   if e_list[b - 1] <= e_list[a - 1]:

       p_list[b - 1] = 0

print((sum(p_list)))
def main():

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

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

#    S = [list(map(int, input(_).split())) for _ in range(M)]

    #LIST = [1] * N

    LIST = [ 1 for _ in range(N)]

    for _ in range(M):

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

        if H[A-1] >= H[B-1]: LIST[B-1] = 0

        if H[A-1] <= H[B-1]: LIST[A-1] = 0

    print((sum(LIST)))



main()
N, M = list(map(int, input().split()))
p_list = [1 for _ in range(N)]
e_list = list(map(int, input().split()))
for _ in range(M):
    a, b = list(map(int, input().split()))
    if e_list[a - 1] <= e_list[b - 1]:
        p_list[a - 1] = 0
    if e_list[b - 1] <= e_list[a - 1]:
        p_list[b - 1] = 0
print((sum(p_list)))

def main():
    N, M = list(map(int, input().split()))
    H = list(map(int, input().split()))
    #    S = [list(map(int, input(_).split())) for _ in range(M)]
    # LIST = [1] * N
    LIST = [1 for _ in range(N)]
    for _ in range(M):
        A, B = list(map(int, input().split()))
        if H[A - 1] >= H[B - 1]:
            LIST[B - 1] = 0
        if H[A - 1] <= H[B - 1]:
            LIST[A - 1] = 0
    print((sum(LIST)))


main()

-N, M = list(map(int, input().split())) -p_list = [1 for _ in range(N)] -e_list = list(map(int, input().split())) -for _ in range(M): -    a, b = list(map(int, input().split())) -    if e_list[a - 1] <= e_list[b - 1]: -        p_list[a - 1] = 0 -    if e_list[b - 1] <= e_list[a - 1]: -        p_list[b - 1] = 0 -print((sum(p_list))) +def main(): +    N, M = list(map(int, input().split())) +    H = list(map(int, input().split())) +    #    S = [list(map(int, input(_).split())) for _ in range(M)] +    # LIST = [1] * N +    LIST = [1 for _ in range(N)] +    for _ in range(M): +        A, B = list(map(int, input().split())) +        if H[A - 1] >= H[B - 1]: +            LIST[B - 1] = 0 +        if H[A - 1] <= H[B - 1]: +            LIST[A - 1] = 0 +    print((sum(LIST))) + + +main()