from heapq import heappush, heappop





def main():



    N, M = [int(v) for v in input().split()]



    H = [int(v) for v in input().split()]



    net = [set() for _ in range(N)]



    for _ in range(M):

        a, b = [int(v) - 1 for v in input().split()]

        net[a].add(b)

        net[b].add(a)



    def goodview(i, h):

        for j in net[i]:

            if H[j] >= h:

                return False

        return True



    count = 0

    for i, h in enumerate(H):

        if goodview(i, h):

            count += 1



    print(count)





main()

from heapq import heappush, heappop





def main():



    N, M = [int(v) for v in input().split()]



    H = [int(v) for v in input().split()]

    link = [0] * N



    for _ in range(M):

        a, b = [int(v) - 1 for v in input().split()]

        link[a] = max(link[a], H[b])

        link[b] = max(link[b], H[a])



    count = 0

    for h, nh in zip(H, link):

        if h > nh:

            count += 1

    print(count)





main()

from heapq import heappush, heappop


def main():
    N, M = [int(v) for v in input().split()]
    H = [int(v) for v in input().split()]
    net = [set() for _ in range(N)]
    for _ in range(M):
        a, b = [int(v) - 1 for v in input().split()]
        net[a].add(b)
        net[b].add(a)

    def goodview(i, h):
        for j in net[i]:
            if H[j] >= h:
                return False
        return True

    count = 0
    for i, h in enumerate(H):
        if goodview(i, h):
            count += 1
    print(count)


main()

from heapq import heappush, heappop


def main():
    N, M = [int(v) for v in input().split()]
    H = [int(v) for v in input().split()]
    link = [0] * N
    for _ in range(M):
        a, b = [int(v) - 1 for v in input().split()]
        link[a] = max(link[a], H[b])
        link[b] = max(link[b], H[a])
    count = 0
    for h, nh in zip(H, link):
        if h > nh:
            count += 1
    print(count)


main()

-    net = [set() for _ in range(N)] +    link = [0] * N -        net[a].add(b) -        net[b].add(a) - -    def goodview(i, h): -        for j in net[i]: -            if H[j] >= h: -                return False -        return True - +        link[a] = max(link[a], H[b]) +        link[b] = max(link[b], H[a]) -    for i, h in enumerate(H): -        if goodview(i, h): +    for h, nh in zip(H, link): +        if h > nh: