def main():

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

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

    to = [0]*(n+1)

    ans = 0

    for _ in range(m):

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

        to[a] = max(to[a], h[b-1])

        to[b] = max(to[b], h[a-1])

    for i, hi in enumerate(h, 1):

        t = to[i]

        if t == 0 or hi > t:

            ans += 1

    print(ans)



if __name__ == "__main__":

    main()
def main():

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

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

    to = [0]*(n+1)

    ans = 0

    for _ in range(m):

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

        to[a] = max(to[a], h[b-1])

        to[b] = max(to[b], h[a-1])

    for i, hi in enumerate(h, 1):

        if hi > to[i]:

            ans += 1

    print(ans)



if __name__ == "__main__":

    main()
def main():
    n, m = list(map(int, input().split()))
    h = list(map(int, input().split()))
    to = [0] * (n + 1)
    ans = 0
    for _ in range(m):
        a, b = list(map(int, input().split()))
        to[a] = max(to[a], h[b - 1])
        to[b] = max(to[b], h[a - 1])
    for i, hi in enumerate(h, 1):
        t = to[i]
        if t == 0 or hi > t:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

def main():
    n, m = list(map(int, input().split()))
    h = list(map(int, input().split()))
    to = [0] * (n + 1)
    ans = 0
    for _ in range(m):
        a, b = list(map(int, input().split()))
        to[a] = max(to[a], h[b - 1])
        to[b] = max(to[b], h[a - 1])
    for i, hi in enumerate(h, 1):
        if hi > to[i]:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

-        t = to[i] -        if t == 0 or hi > t: +        if hi > to[i]: