N,M =  list(map(int, input().split()))

HList = input().split(" ")

ABHash = {}

for i in range(M) :

    A,B = list(map(int, input().split()))

    A = A-1

    B = B-1

    if A not in ABHash :

        ABHash[A] = []

    ABHash[A].append(B)

    if B not in ABHash :

        ABHash[B] = []

    ABHash[B].append(A)



count = 0



for i in range(N) :

    if i not in ABHash :

        count += 1

        continue



    BList = ABHash[i]

    AHeight = int(HList[i])

    isGood = True

    

    for j in range(len(BList)) :

        if AHeight <= int(HList[BList[j]]) :

            isGood = False

    if(isGood) :

        count += 1

print(count)
N, M = list(map(int, input().split()))

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

A = [True for i in range(N)]

for i in range(M) :

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

    a -= 1

    b -= 1

    if(H[a] <= H[b]) :

        A[a] = False

    if(H[b] <= H[a]) :

        A[b] = False



ans = 0

for i in range(N) :

    if(A[i]) :

        ans += 1

print(ans)
N, M = list(map(int, input().split()))
HList = input().split(" ")
ABHash = {}
for i in range(M):
    A, B = list(map(int, input().split()))
    A = A - 1
    B = B - 1
    if A not in ABHash:
        ABHash[A] = []
    ABHash[A].append(B)
    if B not in ABHash:
        ABHash[B] = []
    ABHash[B].append(A)
count = 0
for i in range(N):
    if i not in ABHash:
        count += 1
        continue
    BList = ABHash[i]
    AHeight = int(HList[i])
    isGood = True
    for j in range(len(BList)):
        if AHeight <= int(HList[BList[j]]):
            isGood = False
    if isGood:
        count += 1
print(count)

N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
A = [True for i in range(N)]
for i in range(M):
    a, b = list(map(int, input().split()))
    a -= 1
    b -= 1
    if H[a] <= H[b]:
        A[a] = False
    if H[b] <= H[a]:
        A[b] = False
ans = 0
for i in range(N):
    if A[i]:
        ans += 1
print(ans)

-HList = input().split(" ") -ABHash = {} +H = list(map(int, input().split())) +A = [True for i in range(N)] -    A, B = list(map(int, input().split())) -    A = A - 1 -    B = B - 1 -    if A not in ABHash: -        ABHash[A] = [] -    ABHash[A].append(B) -    if B not in ABHash: -        ABHash[B] = [] -    ABHash[B].append(A) -count = 0 +    a, b = list(map(int, input().split())) +    a -= 1 +    b -= 1 +    if H[a] <= H[b]: +        A[a] = False +    if H[b] <= H[a]: +        A[b] = False +ans = 0 -    if i not in ABHash: -        count += 1 -        continue -    BList = ABHash[i] -    AHeight = int(HList[i]) -    isGood = True -    for j in range(len(BList)): -        if AHeight <= int(HList[BList[j]]): -            isGood = False -    if isGood: -        count += 1 -print(count) +    if A[i]: +        ans += 1 +print(ans)