import sys

read = sys.stdin.read

readline = sys.stdin.readline

readlines = sys.stdin.readlines



def main():

    N,M = list(map(int, readline().split()))

    H = [int(i) for i in readline().split()]

    ab = list(map(int, read().split()))



    E = [[] for _ in range(N+1)]

    for i, (a, b) in enumerate(zip(*[iter(ab)]*2)):

        E[a].append(b)

        E[b].append(a)

    

    ans = 0

    for i in range(1,N+1):

        flag = True

        for v in E[i]:

            if H[i-1] > H[v-1]:

                continue

            else:

                flag = False

                break

        if flag:

            ans += 1



    print(ans)





if __name__ == "__main__":

    main()

import sys

read = sys.stdin.read

readline = sys.stdin.readline

readlines = sys.stdin.readlines



def main():

    N,M = list(map(int, readline().split()))

    H = [int(i) for i in readline().split()]

    ab = list(map(int, read().split()))



    E = [0] * N

    for i, (a, b) in enumerate(zip(*[iter(ab)]*2)):

        if H[b-1] > E[a-1]:

            E[a-1] = H[b-1]

        if H[a-1] > E[b-1]:

            E[b-1] = H[a-1]



    ans = 0

    for i,h in enumerate(H):

        if h > E[i]:

            ans += 1

    

    print(ans)





if __name__ == "__main__":

    main()

import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines


def main():
    N, M = list(map(int, readline().split()))
    H = [int(i) for i in readline().split()]
    ab = list(map(int, read().split()))
    E = [[] for _ in range(N + 1)]
    for i, (a, b) in enumerate(zip(*[iter(ab)] * 2)):
        E[a].append(b)
        E[b].append(a)
    ans = 0
    for i in range(1, N + 1):
        flag = True
        for v in E[i]:
            if H[i - 1] > H[v - 1]:
                continue
            else:
                flag = False
                break
        if flag:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines


def main():
    N, M = list(map(int, readline().split()))
    H = [int(i) for i in readline().split()]
    ab = list(map(int, read().split()))
    E = [0] * N
    for i, (a, b) in enumerate(zip(*[iter(ab)] * 2)):
        if H[b - 1] > E[a - 1]:
            E[a - 1] = H[b - 1]
        if H[a - 1] > E[b - 1]:
            E[b - 1] = H[a - 1]
    ans = 0
    for i, h in enumerate(H):
        if h > E[i]:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

-    E = [[] for _ in range(N + 1)] +    E = [0] * N -        E[a].append(b) -        E[b].append(a) +        if H[b - 1] > E[a - 1]: +            E[a - 1] = H[b - 1] +        if H[a - 1] > E[b - 1]: +            E[b - 1] = H[a - 1] -    for i in range(1, N + 1): -        flag = True -        for v in E[i]: -            if H[i - 1] > H[v - 1]: -                continue -            else: -                flag = False -                break -        if flag: +    for i, h in enumerate(H): +        if h > E[i]: