import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines

sys.setrecursionlimit(10 ** 7)



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

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

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

memo = [True] * n

for a, b in ab:

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

        memo[b - 1] = False

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

        memo[a - 1] = False

    else:

        memo[a - 1] = False

        memo[b - 1] = False

print((memo.count(True)))

import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines

sys.setrecursionlimit(10 ** 7)



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

h = [0] + list(map(int, readline().split()))

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

check = [True] * (n + 1)

for a, b in ab:

    if h[a] > h[b]:

        check[b] = False

    elif h[a] < h[b]:

        check[a] = False

    else:

        check[a] = False

        check[b] = False

print((check.count(True) - 1))

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**7)
n, m = list(map(int, readline().split()))
h = list(map(int, readline().split()))
ab = [list(map(int, readline().split())) for _ in range(m)]
memo = [True] * n
for a, b in ab:
    if h[a - 1] > h[b - 1]:
        memo[b - 1] = False
    elif h[a - 1] < h[b - 1]:
        memo[a - 1] = False
    else:
        memo[a - 1] = False
        memo[b - 1] = False
print((memo.count(True)))

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**7)
n, m = list(map(int, readline().split()))
h = [0] + list(map(int, readline().split()))
ab = [list(map(int, readline().split())) for _ in range(m)]
check = [True] * (n + 1)
for a, b in ab:
    if h[a] > h[b]:
        check[b] = False
    elif h[a] < h[b]:
        check[a] = False
    else:
        check[a] = False
        check[b] = False
print((check.count(True) - 1))

-h = list(map(int, readline().split())) +h = [0] + list(map(int, readline().split())) -memo = [True] * n +check = [True] * (n + 1) -    if h[a - 1] > h[b - 1]: -        memo[b - 1] = False -    elif h[a - 1] < h[b - 1]: -        memo[a - 1] = False +    if h[a] > h[b]: +        check[b] = False +    elif h[a] < h[b]: +        check[a] = False -        memo[a - 1] = False -        memo[b - 1] = False -print((memo.count(True))) +        check[a] = False +        check[b] = False +print((check.count(True) - 1))