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

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

N,M=MI()

Ten=[1 for _ in range(N)]

Michi=[[] for _ in range(N)]

H=LI()

for i in range(M):

  a,b=MI()

  a-=1

  b-=1

  Michi[a].append(b)

  Michi[b].append(a)  

for i in range(N):

  for j in Michi[i]:

    if H[i]<=H[j]:

      Ten[i]=0

      break

ans=sum(Ten)

print(ans)
def II(): return int(eval(input()))

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

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



N,M=MI()

H=LI()

ans=0

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

Ten=[1] *N

for i in range(M):

  a,b=MI()

  a-=1

  b-=1

  Michi[a].append(b)

  Michi[b].append(a)

for j in range(N):  

  for k in Michi[j]:

    if H[k]>=H[j]:

      Ten[j]=0

      break

ans=sum(Ten)

print(ans)
def MI():
    return list(map(int, input().split()))


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


N, M = MI()
Ten = [1 for _ in range(N)]
Michi = [[] for _ in range(N)]
H = LI()
for i in range(M):
    a, b = MI()
    a -= 1
    b -= 1
    Michi[a].append(b)
    Michi[b].append(a)
for i in range(N):
    for j in Michi[i]:
        if H[i] <= H[j]:
            Ten[i] = 0
            break
ans = sum(Ten)
print(ans)

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


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


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


N, M = MI()
H = LI()
ans = 0
Michi = [[] for i in range(N)]
Ten = [1] * N
for i in range(M):
    a, b = MI()
    a -= 1
    b -= 1
    Michi[a].append(b)
    Michi[b].append(a)
for j in range(N):
    for k in Michi[j]:
        if H[k] >= H[j]:
            Ten[j] = 0
            break
ans = sum(Ten)
print(ans)

+def II(): +    return int(eval(input())) + + -Ten = [1 for _ in range(N)] -Michi = [[] for _ in range(N)] +ans = 0 +Michi = [[] for i in range(N)] +Ten = [1] * N -for i in range(N): -    for j in Michi[i]: -        if H[i] <= H[j]: -            Ten[i] = 0 +for j in range(N): +    for k in Michi[j]: +        if H[k] >= H[j]: +            Ten[j] = 0