import numpy as np



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

H = [int(a) for a in input().split()]

good = np.zeros(N, dtype=int)

for i in range(M):

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

    a -= 1

    b -= 1

    if H[a] > H[b]:

        good[b] += 1

    elif H[a] < H[b]:

        good[a] += 1

    else:

        good[a] += 1

        good[b] += 1



ans = 0

for i in good:

    if i == 0:

        ans += 1

print(ans)

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

H = [int(i) for i in input().split()]

HP = [0] * N

for _ in range(M):

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

    A -= 1

    B -= 1

    if H[A] > H[B]:

        HP[B] += 1

    elif H[A] < H[B]:

        HP[A] += 1

    else:

        HP[A] += 1

        HP[B] += 1



print((HP.count(0)))
import numpy as np

N, M = list(map(int, input().split()))
H = [int(a) for a in input().split()]
good = np.zeros(N, dtype=int)
for i in range(M):
    a, b = list(map(int, input().split()))
    a -= 1
    b -= 1
    if H[a] > H[b]:
        good[b] += 1
    elif H[a] < H[b]:
        good[a] += 1
    else:
        good[a] += 1
        good[b] += 1
ans = 0
for i in good:
    if i == 0:
        ans += 1
print(ans)

N, M = list(map(int, input().split()))
H = [int(i) for i in input().split()]
HP = [0] * N
for _ in range(M):
    A, B = list(map(int, input().split()))
    A -= 1
    B -= 1
    if H[A] > H[B]:
        HP[B] += 1
    elif H[A] < H[B]:
        HP[A] += 1
    else:
        HP[A] += 1
        HP[B] += 1
print((HP.count(0)))

-import numpy as np - -H = [int(a) for a in input().split()] -good = np.zeros(N, dtype=int) -for i in range(M): -    a, b = list(map(int, input().split())) -    a -= 1 -    b -= 1 -    if H[a] > H[b]: -        good[b] += 1 -    elif H[a] < H[b]: -        good[a] += 1 +H = [int(i) for i in input().split()] +HP = [0] * N +for _ in range(M): +    A, B = list(map(int, input().split())) +    A -= 1 +    B -= 1 +    if H[A] > H[B]: +        HP[B] += 1 +    elif H[A] < H[B]: +        HP[A] += 1 -        good[a] += 1 -        good[b] += 1 -ans = 0 -for i in good: -    if i == 0: -        ans += 1 -print(ans) +        HP[A] += 1 +        HP[B] += 1 +print((HP.count(0)))