import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines





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

h = list(map(int, readline().split()))

ab = [list(map(int, input().split())) for _ in range(m)]

l = [1]*n

for i in range(m):

    if h[ab[i][0] - 1] < h[ab[i][1] - 1]:

        l[ab[i][0] - 1] = 0

    elif h[ab[i][0] - 1] > h[ab[i][1] - 1]:

        l[ab[i][1] - 1] = 0

    else:

        l[ab[i][0] - 1] = 0

        l[ab[i][1] - 1] = 0

print((sum(l)))
import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines



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

h = list(map(int, readline().split()))



l = [1]*n

for i in range(m):

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

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

        l[a - 1] = 0

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

        l[b - 1] = 0

    else:

        l[a - 1] = 0

        l[b - 1] = 0

print((sum(l)))

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
n, m = list(map(int, readline().split()))
h = list(map(int, readline().split()))
ab = [list(map(int, input().split())) for _ in range(m)]
l = [1] * n
for i in range(m):
    if h[ab[i][0] - 1] < h[ab[i][1] - 1]:
        l[ab[i][0] - 1] = 0
    elif h[ab[i][0] - 1] > h[ab[i][1] - 1]:
        l[ab[i][1] - 1] = 0
    else:
        l[ab[i][0] - 1] = 0
        l[ab[i][1] - 1] = 0
print((sum(l)))

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
n, m = list(map(int, readline().split()))
h = list(map(int, readline().split()))
l = [1] * n
for i in range(m):
    a, b = list(map(int, readline().split()))
    if h[a - 1] < h[b - 1]:
        l[a - 1] = 0
    elif h[a - 1] > h[b - 1]:
        l[b - 1] = 0
    else:
        l[a - 1] = 0
        l[b - 1] = 0
print((sum(l)))

-ab = [list(map(int, input().split())) for _ in range(m)] -    if h[ab[i][0] - 1] < h[ab[i][1] - 1]: -        l[ab[i][0] - 1] = 0 -    elif h[ab[i][0] - 1] > h[ab[i][1] - 1]: -        l[ab[i][1] - 1] = 0 +    a, b = list(map(int, readline().split())) +    if h[a - 1] < h[b - 1]: +        l[a - 1] = 0 +    elif h[a - 1] > h[b - 1]: +        l[b - 1] = 0 -        l[ab[i][0] - 1] = 0 -        l[ab[i][1] - 1] = 0 +        l[a - 1] = 0 +        l[b - 1] = 0