# coding: utf-8





def solve(*args: str) -> str:

    n, m = list(map(int, args[0].split()))

    H = list(map(int, args[1].split()))

    AB = [tuple(map(int, ab.split())) for ab in args[2:]]



    R = [set() for _ in range(n)]

    for a, b in AB:

        R[a-1].add(b-1)

        R[b-1].add(a-1)



    ret = 0

    for i, D in enumerate(R):

        if len(D) == 0 or max([H[d] for d in D]) < H[i]:

            ret += 1



    return str(ret)





if __name__ == "__main__":

    print((solve(*(open(0).read().splitlines()))))

# coding: utf-8





def solve(*args: str) -> str:

    n, m = list(map(int, args[0].split()))

    H = [0]+list(map(int, args[1].split()))

    AB = [tuple(map(int, ab.split())) for ab in args[2:]]



    G = [True]*(n+1)

    for a, b in AB:

        G[a] &= H[b] < H[a]

        G[b] &= H[a] < H[b]



    return str(sum(G[1:]))





if __name__ == "__main__":

    print((solve(*(open(0).read().splitlines()))))

# coding: utf-8
def solve(*args: str) -> str:
    n, m = list(map(int, args[0].split()))
    H = list(map(int, args[1].split()))
    AB = [tuple(map(int, ab.split())) for ab in args[2:]]
    R = [set() for _ in range(n)]
    for a, b in AB:
        R[a - 1].add(b - 1)
        R[b - 1].add(a - 1)
    ret = 0
    for i, D in enumerate(R):
        if len(D) == 0 or max([H[d] for d in D]) < H[i]:
            ret += 1
    return str(ret)


if __name__ == "__main__":
    print((solve(*(open(0).read().splitlines()))))

# coding: utf-8
def solve(*args: str) -> str:
    n, m = list(map(int, args[0].split()))
    H = [0] + list(map(int, args[1].split()))
    AB = [tuple(map(int, ab.split())) for ab in args[2:]]
    G = [True] * (n + 1)
    for a, b in AB:
        G[a] &= H[b] < H[a]
        G[b] &= H[a] < H[b]
    return str(sum(G[1:]))


if __name__ == "__main__":
    print((solve(*(open(0).read().splitlines()))))

-    H = list(map(int, args[1].split())) +    H = [0] + list(map(int, args[1].split())) -    R = [set() for _ in range(n)] +    G = [True] * (n + 1) -        R[a - 1].add(b - 1) -        R[b - 1].add(a - 1) -    ret = 0 -    for i, D in enumerate(R): -        if len(D) == 0 or max([H[d] for d in D]) < H[i]: -            ret += 1 -    return str(ret) +        G[a] &= H[b] < H[a] +        G[b] &= H[a] < H[b] +    return str(sum(G[1:]))