import bisect

import collections

import sys



sys.setrecursionlimit(100000)

input = sys.stdin.readline

ACMOD = 1000000007

INF = 1 << 62





def lmi():

    return list(map(int, input().split()))





def llmi(n):

    return [lmi() for _ in range(n)]





N, M = lmi()

H = lmi()



AB = llmi(M)

adj = collections.defaultdict(set)

for a, b in AB:

    a = a - 1

    b = b - 1

    adj[a].add(b)

    adj[b].add(a)



ans = 0

for i, h in enumerate(H):

    flag = True

    for j in adj[i]:

        if H[j] >= h:

            break

    else:

        ans += 1

print(ans)

import bisect

import collections

import sys



sys.setrecursionlimit(100000)

input = sys.stdin.readline

ACMOD = 1000000007

INF = 1 << 62





def lmi():

    return list(map(int, input().split()))





def llmi(n):

    return [lmi() for _ in range(n)]





N, M = lmi()

H = lmi()



AB = llmi(M)

flag = [1] * N

for a, b in AB:

    a = a - 1

    b = b - 1

    ha = H[a]

    hb = H[b]

    if ha >= hb:

        flag[b] = 0

    if hb >= ha:

        flag[a] = 0

print((sum(flag)))

import bisect
import collections
import sys

sys.setrecursionlimit(100000)
input = sys.stdin.readline
ACMOD = 1000000007
INF = 1 << 62


def lmi():
    return list(map(int, input().split()))


def llmi(n):
    return [lmi() for _ in range(n)]


N, M = lmi()
H = lmi()
AB = llmi(M)
adj = collections.defaultdict(set)
for a, b in AB:
    a = a - 1
    b = b - 1
    adj[a].add(b)
    adj[b].add(a)
ans = 0
for i, h in enumerate(H):
    flag = True
    for j in adj[i]:
        if H[j] >= h:
            break
    else:
        ans += 1
print(ans)

import bisect
import collections
import sys

sys.setrecursionlimit(100000)
input = sys.stdin.readline
ACMOD = 1000000007
INF = 1 << 62


def lmi():
    return list(map(int, input().split()))


def llmi(n):
    return [lmi() for _ in range(n)]


N, M = lmi()
H = lmi()
AB = llmi(M)
flag = [1] * N
for a, b in AB:
    a = a - 1
    b = b - 1
    ha = H[a]
    hb = H[b]
    if ha >= hb:
        flag[b] = 0
    if hb >= ha:
        flag[a] = 0
print((sum(flag)))

-adj = collections.defaultdict(set) +flag = [1] * N -    adj[a].add(b) -    adj[b].add(a) -ans = 0 -for i, h in enumerate(H): -    flag = True -    for j in adj[i]: -        if H[j] >= h: -            break -    else: -        ans += 1 -print(ans) +    ha = H[a] +    hb = H[b] +    if ha >= hb: +        flag[b] = 0 +    if hb >= ha: +        flag[a] = 0 +print((sum(flag)))