#n=int(input())

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

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

#l=[list(map(int,input().split())) for i in range(n)]

dic={}

for i in range(m):

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

    if hl[a-1]<=hl[b-1]:

        dic[a]=False

    if hl[b-1]<=hl[a-1]:

        dic[b]=False



print((n-len(dic)))

#n = int(input())

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

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

#al=[list(input()) for i in range(n)]



isgood = [True for _ in range(n)]



for i in range(m):

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

    if hl[a-1] <= hl[b-1]:

        isgood[a-1] = False

    if hl[b-1] <= hl[a-1]:

        isgood[b-1] = False

print((isgood.count(True)))

# n=int(input())
n, m = list(map(int, input().split()))
hl = list(map(int, input().split()))
# l=[list(map(int,input().split())) for i in range(n)]
dic = {}
for i in range(m):
    a, b = list(map(int, input().split()))
    if hl[a - 1] <= hl[b - 1]:
        dic[a] = False
    if hl[b - 1] <= hl[a - 1]:
        dic[b] = False
print((n - len(dic)))

# n = int(input())
n, m = list(map(int, input().split()))
hl = list(map(int, input().split()))
# al=[list(input()) for i in range(n)]
isgood = [True for _ in range(n)]
for i in range(m):
    a, b = list(map(int, input().split()))
    if hl[a - 1] <= hl[b - 1]:
        isgood[a - 1] = False
    if hl[b - 1] <= hl[a - 1]:
        isgood[b - 1] = False
print((isgood.count(True)))

-# n=int(input()) +# n = int(input()) -# l=[list(map(int,input().split())) for i in range(n)] -dic = {} +# al=[list(input()) for i in range(n)] +isgood = [True for _ in range(n)] -        dic[a] = False +        isgood[a - 1] = False -        dic[b] = False -print((n - len(dic))) +        isgood[b - 1] = False +print((isgood.count(True)))