from collections import deque

n,m=[int(_) for _ in input().split()]

H=[int(_) for _ in input().split()]

Hlist=deque(deque() for a in range(n))

count=0

for a in range(m):

    a,b=[int(_) for _ in input().split()]

    Hlist[a-1].append(b-1)

    Hlist[b-1].append(a-1)

for i,j in enumerate(Hlist):

    flag=1

    for a in j:

        if H[a]>=H[i]:

            flag=0

    if flag==1:

        count+=1

    flag=1

print(count)
n,m=list(map(int,input().split()))

li = []

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

for i in range(m):

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

    if h[a-1]<h[b-1]:

        li.append(a)

    elif h[a-1]==h[b-1]:

        li.append(a)

        li.append(b)

    else:

        li.append(b)

print((n-len(set(li))))

from collections import deque

n, m = [int(_) for _ in input().split()]
H = [int(_) for _ in input().split()]
Hlist = deque(deque() for a in range(n))
count = 0
for a in range(m):
    a, b = [int(_) for _ in input().split()]
    Hlist[a - 1].append(b - 1)
    Hlist[b - 1].append(a - 1)
for i, j in enumerate(Hlist):
    flag = 1
    for a in j:
        if H[a] >= H[i]:
            flag = 0
    if flag == 1:
        count += 1
    flag = 1
print(count)

n, m = list(map(int, input().split()))
li = []
h = list(map(int, input().split()))
for i in range(m):
    a, b = list(map(int, input().split()))
    if h[a - 1] < h[b - 1]:
        li.append(a)
    elif h[a - 1] == h[b - 1]:
        li.append(a)
        li.append(b)
    else:
        li.append(b)
print((n - len(set(li))))

-from collections import deque - -n, m = [int(_) for _ in input().split()] -H = [int(_) for _ in input().split()] -Hlist = deque(deque() for a in range(n)) -count = 0 -for a in range(m): -    a, b = [int(_) for _ in input().split()] -    Hlist[a - 1].append(b - 1) -    Hlist[b - 1].append(a - 1) -for i, j in enumerate(Hlist): -    flag = 1 -    for a in j: -        if H[a] >= H[i]: -            flag = 0 -    if flag == 1: -        count += 1 -    flag = 1 -print(count) +n, m = list(map(int, input().split())) +li = [] +h = list(map(int, input().split())) +for i in range(m): +    a, b = list(map(int, input().split())) +    if h[a - 1] < h[b - 1]: +        li.append(a) +    elif h[a - 1] == h[b - 1]: +        li.append(a) +        li.append(b) +    else: +        li.append(b) +print((n - len(set(li))))