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

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



adj = {i:[] for i in range(N)}

for _ in range(M):

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

	adj[A-1].append(H[B-1])

	adj[B-1].append(H[A-1])



cnt = 0

for v in range(N):

	if not adj[v]:

		cnt += 1

		continue

	if H[v] > max(adj[v]):

		cnt += 1



print(cnt)
import sys



read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines



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

H = [0] + list(map(int, readline().split()))

A = [0]*(N+1)



m = list(map(int, read().split()))

for a,b in zip(m,m):

	for _ in range(2):

		A[a] = max(A[a], H[b])

		a,b = b,a



print((sum(x>y for x,y in zip(H, A))))
N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
adj = {i: [] for i in range(N)}
for _ in range(M):
    A, B = list(map(int, input().split()))
    adj[A - 1].append(H[B - 1])
    adj[B - 1].append(H[A - 1])
cnt = 0
for v in range(N):
    if not adj[v]:
        cnt += 1
        continue
    if H[v] > max(adj[v]):
        cnt += 1
print(cnt)

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N, M = list(map(int, readline().split()))
H = [0] + list(map(int, readline().split()))
A = [0] * (N + 1)
m = list(map(int, read().split()))
for a, b in zip(m, m):
    for _ in range(2):
        A[a] = max(A[a], H[b])
        a, b = b, a
print((sum(x > y for x, y in zip(H, A))))

-N, M = list(map(int, input().split())) -H = list(map(int, input().split())) -adj = {i: [] for i in range(N)} -for _ in range(M): -    A, B = list(map(int, input().split())) -    adj[A - 1].append(H[B - 1]) -    adj[B - 1].append(H[A - 1]) -cnt = 0 -for v in range(N): -    if not adj[v]: -        cnt += 1 -        continue -    if H[v] > max(adj[v]): -        cnt += 1 -print(cnt) +import sys + +read = sys.stdin.buffer.read +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines +N, M = list(map(int, readline().split())) +H = [0] + list(map(int, readline().split())) +A = [0] * (N + 1) +m = list(map(int, read().split())) +for a, b in zip(m, m): +    for _ in range(2): +        A[a] = max(A[a], H[b]) +        a, b = b, a +print((sum(x > y for x, y in zip(H, A))))