#coding: utf-8

#coding: utf-8

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

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

d = {i:H[i-1] for i in range(1, N+1)}

F = [True for _ in range(N)]

for i in range(M):

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

    if d[a] <= H[b-1]:

        F[a-1] = False

    if d[b] <= H[a-1]:

        F[b-1] = False

print((sum(F)))
#coding: utf-8

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

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

ans = [True for _ in range(N)]

for i in range(M):

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

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

        ans[a-1] = False

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

        ans[b-1] = False

print((sum(ans)))



# coding: utf-8
# coding: utf-8
N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
d = {i: H[i - 1] for i in range(1, N + 1)}
F = [True for _ in range(N)]
for i in range(M):
    a, b = list(map(int, input().split()))
    if d[a] <= H[b - 1]:
        F[a - 1] = False
    if d[b] <= H[a - 1]:
        F[b - 1] = False
print((sum(F)))

# coding: utf-8
N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
ans = [True for _ in range(N)]
for i in range(M):
    a, b = list(map(int, input().split()))
    if H[a - 1] <= H[b - 1]:
        ans[a - 1] = False
    if H[b - 1] <= H[a - 1]:
        ans[b - 1] = False
print((sum(ans)))

-# coding: utf-8 -d = {i: H[i - 1] for i in range(1, N + 1)} -F = [True for _ in range(N)] +ans = [True for _ in range(N)] -    if d[a] <= H[b - 1]: -        F[a - 1] = False -    if d[b] <= H[a - 1]: -        F[b - 1] = False -print((sum(F))) +    if H[a - 1] <= H[b - 1]: +        ans[a - 1] = False +    if H[b - 1] <= H[a - 1]: +        ans[b - 1] = False +print((sum(ans)))