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:

            num=0

            for j in edge[i]:

                if val>H[j]:

                    num+=1

            if num==len(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()))

    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()))  # 頂点の数、辺の数
    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:
            num = 0
            for j in edge[i]:
                if val > H[j]:
                    num += 1
            if num == len(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()))
    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()

-    N, M = list(map(int, input().split()))  # 頂点の数、辺の数 +    N, M = list(map(int, input().split())) -        edge[y].append(x)  # 有向なら#つける +        edge[y].append(x) -            num = 0 -            for j in edge[i]: -                if val > H[j]: -                    num += 1 -            if num == len(edge[i]): +            if all(val > H[j] for j in edge[i]):