from sys import stdin

import math

import fractions

from collections import deque

from collections import Counter

import itertools



INF = 10 ** 10



N, M = [int(x) for x in stdin.readline().rstrip().split()]

# 展望台iの標高

H = [int(x) for x in stdin.readline().rstrip().split()]

AB = [list(map(int, stdin.readline().rstrip().split())) for _ in range(M)]



dic = {}

for i in range(N):

    dic[i+1] = []



for A, B in AB:

    dic[A].append(B)

    dic[B].append(A)



ans = 0

i = len(dic)

while i > 0:

    key = i

    values = set(dic[i])

    near_H = [H[value-1] for value in values]

    if near_H:

        if H[key-1] > max(near_H):

            ans += 1

    else:

        ans += 1

    i -= 1



print(ans)

from sys import stdin

import math

import fractions

from collections import deque

from collections import Counter

import itertools



INF = 10 ** 10



N, M = [int(x) for x in stdin.readline().rstrip().split()]

# 展望台iの標高

H = [0] + [int(x) for x in stdin.readline().rstrip().split()]

AB = [list(map(int, stdin.readline().rstrip().split())) for _ in range(M)]



near_max = [0 for _ in range(N+1)]



for A, B in AB:

    near_max[A] = max(near_max[A], H[B])

    near_max[B] = max(near_max[B], H[A])



ans = 0



for i in range(1, N+1):

    if H[i] > near_max[i]:

        ans += 1



print(ans)
from sys import stdin
import math
import fractions
from collections import deque
from collections import Counter
import itertools

INF = 10**10
N, M = [int(x) for x in stdin.readline().rstrip().split()]
# 展望台iの標高
H = [int(x) for x in stdin.readline().rstrip().split()]
AB = [list(map(int, stdin.readline().rstrip().split())) for _ in range(M)]
dic = {}
for i in range(N):
    dic[i + 1] = []
for A, B in AB:
    dic[A].append(B)
    dic[B].append(A)
ans = 0
i = len(dic)
while i > 0:
    key = i
    values = set(dic[i])
    near_H = [H[value - 1] for value in values]
    if near_H:
        if H[key - 1] > max(near_H):
            ans += 1
    else:
        ans += 1
    i -= 1
print(ans)

from sys import stdin
import math
import fractions
from collections import deque
from collections import Counter
import itertools

INF = 10**10
N, M = [int(x) for x in stdin.readline().rstrip().split()]
# 展望台iの標高
H = [0] + [int(x) for x in stdin.readline().rstrip().split()]
AB = [list(map(int, stdin.readline().rstrip().split())) for _ in range(M)]
near_max = [0 for _ in range(N + 1)]
for A, B in AB:
    near_max[A] = max(near_max[A], H[B])
    near_max[B] = max(near_max[B], H[A])
ans = 0
for i in range(1, N + 1):
    if H[i] > near_max[i]:
        ans += 1
print(ans)

-H = [int(x) for x in stdin.readline().rstrip().split()] +H = [0] + [int(x) for x in stdin.readline().rstrip().split()] -dic = {} -for i in range(N): -    dic[i + 1] = [] +near_max = [0 for _ in range(N + 1)] -    dic[A].append(B) -    dic[B].append(A) +    near_max[A] = max(near_max[A], H[B]) +    near_max[B] = max(near_max[B], H[A]) -i = len(dic) -while i > 0: -    key = i -    values = set(dic[i]) -    near_H = [H[value - 1] for value in values] -    if near_H: -        if H[key - 1] > max(near_H): -            ans += 1 -    else: +for i in range(1, N + 1): +    if H[i] > near_max[i]: -    i -= 1