import sys

sys.setrecursionlimit(700000)



def s_in():

    return eval(input())



def n_in():

    return int(eval(input()))



def l_in():

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



n,m = l_in()

h = l_in()



edges=[[] for _ in range(n)]

good=[True]*n



for _ in range(m):

    a,b=l_in()

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

        good[a-1] = good[a-1] and True

        good[b-1] = False

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

        good[b-1] = good[b-1] and True

        good[a-1] = False

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

        good[b-1] = False

        good[a-1] = False



print((len(list([a for a in good if a]))))

        

import sys

sys.setrecursionlimit(700000)



def s_in():

    return eval(input())



def n_in():

    return int(eval(input()))



def l_in():

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



n,m = l_in()

h = l_in()



edges=[[] for _ in range(n)]

good=[True]*n



for _ in range(m):

    a,b=l_in()

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

        good[a-1] = good[a-1] and True

        good[b-1] = False

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

        good[b-1] = good[b-1] and True

        good[a-1] = False

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

        good[b-1] = False

        good[a-1] = False



print((sum(good)))

        

import sys

sys.setrecursionlimit(700000)


def s_in():
    return eval(input())


def n_in():
    return int(eval(input()))


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


n, m = l_in()
h = l_in()
edges = [[] for _ in range(n)]
good = [True] * n
for _ in range(m):
    a, b = l_in()
    if h[a - 1] > h[b - 1]:
        good[a - 1] = good[a - 1] and True
        good[b - 1] = False
    if h[b - 1] > h[a - 1]:
        good[b - 1] = good[b - 1] and True
        good[a - 1] = False
    if h[b - 1] == h[a - 1]:
        good[b - 1] = False
        good[a - 1] = False
print((len(list([a for a in good if a]))))

import sys

sys.setrecursionlimit(700000)


def s_in():
    return eval(input())


def n_in():
    return int(eval(input()))


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


n, m = l_in()
h = l_in()
edges = [[] for _ in range(n)]
good = [True] * n
for _ in range(m):
    a, b = l_in()
    if h[a - 1] > h[b - 1]:
        good[a - 1] = good[a - 1] and True
        good[b - 1] = False
    if h[b - 1] > h[a - 1]:
        good[b - 1] = good[b - 1] and True
        good[a - 1] = False
    if h[b - 1] == h[a - 1]:
        good[b - 1] = False
        good[a - 1] = False
print((sum(good)))

-print((len(list([a for a in good if a])))) +print((sum(good)))