import sys

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

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

G = [set() for _ in range(N)]

for _ in range(M):

    A, B = list(map(int, sys.stdin.readline().split()))

    A -= 1

    B -= 1

    G[A].add(B)

    G[B].add(A)



ans = 0

for p in range(N):

    if not G[p]:

        ans += 1

        continue

    for np in G[p]:

        if H[p] <= H[np]:

            break

    else:

        ans += 1

print(ans)
import sys

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

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

G = [set() for _ in range(N)]

for _ in range(M):

    a, b = list(map(int, sys.stdin.readline().split()))

    G[a-1].add(b-1)

    G[b-1].add(a-1)



ans = 0

for i in range(N):

    h = H[i]

    for j in G[i]:

        if h <= H[j]:

            break

    else:

        ans += 1

print(ans)
import sys

N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
G = [set() for _ in range(N)]
for _ in range(M):
    A, B = list(map(int, sys.stdin.readline().split()))
    A -= 1
    B -= 1
    G[A].add(B)
    G[B].add(A)
ans = 0
for p in range(N):
    if not G[p]:
        ans += 1
        continue
    for np in G[p]:
        if H[p] <= H[np]:
            break
    else:
        ans += 1
print(ans)

import sys

N, M = list(map(int, input().split()))
H = tuple(map(int, input().split()))
G = [set() for _ in range(N)]
for _ in range(M):
    a, b = list(map(int, sys.stdin.readline().split()))
    G[a - 1].add(b - 1)
    G[b - 1].add(a - 1)
ans = 0
for i in range(N):
    h = H[i]
    for j in G[i]:
        if h <= H[j]:
            break
    else:
        ans += 1
print(ans)

-H = list(map(int, input().split())) +H = tuple(map(int, input().split())) -    A, B = list(map(int, sys.stdin.readline().split())) -    A -= 1 -    B -= 1 -    G[A].add(B) -    G[B].add(A) +    a, b = list(map(int, sys.stdin.readline().split())) +    G[a - 1].add(b - 1) +    G[b - 1].add(a - 1) -for p in range(N): -    if not G[p]: -        ans += 1 -        continue -    for np in G[p]: -        if H[p] <= H[np]: +for i in range(N): +    h = H[i] +    for j in G[i]: +        if h <= H[j]: