import sys

def input(): return sys.stdin.readline().strip()



def resolve():

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

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

    edge = [[] for i in range(N)]

    for i in range(M):

        x, y = list(map(int, input().split()))

        x, y = x - 1, y - 1

        edge[x].append(y)

        edge[y].append(x)

    cnt=0

    for i in range(N):

        val=H[i]

        if edge[i]==[]:

            cnt+=1

        else:

            if all(val>H[j] for j in edge[i]):

                    cnt+=1

    print(cnt)

resolve()
import sys

def input(): return sys.stdin.readline().strip()



def resolve():

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

    hl=[0]+list(map(int,input().split()))

    #どことも繋がっていない展望台もgoodだから、最後にTrueのままになっているのを数える

    checkl=[True]*n

    for i in range(m):

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

        if hl[a]<hl[b]:

            checkl[a-1]=False

        elif hl[a]>hl[b]:

            checkl[b-1]=False

        else:

            checkl[a-1]=checkl[b-1]=False

    ans=0

    for i in range(n):

        if checkl[i]:

            ans+=1

    print(ans)

resolve()
import sys


def input():
    return sys.stdin.readline().strip()


def resolve():
    N, M = list(map(int, input().split()))
    H = list(map(int, input().split()))
    edge = [[] for i in range(N)]
    for i in range(M):
        x, y = list(map(int, input().split()))
        x, y = x - 1, y - 1
        edge[x].append(y)
        edge[y].append(x)
    cnt = 0
    for i in range(N):
        val = H[i]
        if edge[i] == []:
            cnt += 1
        else:
            if all(val > H[j] for j in edge[i]):
                cnt += 1
    print(cnt)


resolve()

import sys


def input():
    return sys.stdin.readline().strip()


def resolve():
    n, m = list(map(int, input().split()))
    hl = [0] + list(map(int, input().split()))
    # どことも繋がっていない展望台もgoodだから、最後にTrueのままになっているのを数える
    checkl = [True] * n
    for i in range(m):
        a, b = list(map(int, input().split()))
        if hl[a] < hl[b]:
            checkl[a - 1] = False
        elif hl[a] > hl[b]:
            checkl[b - 1] = False
        else:
            checkl[a - 1] = checkl[b - 1] = False
    ans = 0
    for i in range(n):
        if checkl[i]:
            ans += 1
    print(ans)


resolve()

-    N, M = list(map(int, input().split())) -    H = list(map(int, input().split())) -    edge = [[] for i in range(N)] -    for i in range(M): -        x, y = list(map(int, input().split())) -        x, y = x - 1, y - 1 -        edge[x].append(y) -        edge[y].append(x) -    cnt = 0 -    for i in range(N): -        val = H[i] -        if edge[i] == []: -            cnt += 1 +    n, m = list(map(int, input().split())) +    hl = [0] + list(map(int, input().split())) +    # どことも繋がっていない展望台もgoodだから、最後にTrueのままになっているのを数える +    checkl = [True] * n +    for i in range(m): +        a, b = list(map(int, input().split())) +        if hl[a] < hl[b]: +            checkl[a - 1] = False +        elif hl[a] > hl[b]: +            checkl[b - 1] = False -            if all(val > H[j] for j in edge[i]): -                cnt += 1 -    print(cnt) +            checkl[a - 1] = checkl[b - 1] = False +    ans = 0 +    for i in range(n): +        if checkl[i]: +            ans += 1 +    print(ans)