#input

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

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

dp = [1] * N

for _ in range(M):

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

    if H[A-1] > H[B-1]:

        dp[B-1] = 0

    elif H[A-1] < H[B-1]:

        dp[A-1] = 0

    elif H[A-1] == H[B-1]:

        dp[A-1] = 0

        dp[B-1] = 0



#output

print((sum(dp)))
#input

def main():

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

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

    dp = [1] * N

    for _ in range(M):

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

        if H[A-1] > H[B-1]:

            dp[B-1] = 0

        elif H[A-1] < H[B-1]:

            dp[A-1] = 0

        elif H[A-1] == H[B-1]:

            dp[A-1] = 0

            dp[B-1] = 0



#output

    print((sum(dp)))



if __name__ == "__main__":

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

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


if __name__ == "__main__":
    main()

-N, M = list(map(int, input().split())) -H = list(map(int, input().split())) -dp = [1] * N -for _ in range(M): -    A, B = list(map(int, input().split())) -    if H[A - 1] > H[B - 1]: -        dp[B - 1] = 0 -    elif H[A - 1] < H[B - 1]: -        dp[A - 1] = 0 -    elif H[A - 1] == H[B - 1]: -        dp[A - 1] = 0 -        dp[B - 1] = 0 -# output -print((sum(dp))) +def main(): +    N, M = list(map(int, input().split())) +    H = list(map(int, input().split())) +    dp = [1] * N +    for _ in range(M): +        A, B = list(map(int, input().split())) +        if H[A - 1] > H[B - 1]: +            dp[B - 1] = 0 +        elif H[A - 1] < H[B - 1]: +            dp[A - 1] = 0 +        elif H[A - 1] == H[B - 1]: +            dp[A - 1] = 0 +            dp[B - 1] = 0 +    # output +    print((sum(dp))) + + +if __name__ == "__main__": +    main()