def main():

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

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

    ab = []

    g = []

    for _ in range(n):

        g.append([])

    for _ in range(m):

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

        ab.append([a, b])

        g[a - 1].append(b - 1)

        g[b - 1].append(a - 1)

    ans = 0

    for i in range(n):

        check = True

        for j in g[i]:

            if h[j] >= h[i]:

                check = False

        if check:

            ans += 1



    print(ans)





if __name__ == "__main__":

    main()

def main():

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

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

    ab = []

    g = [[] for _ in range(n)]

    for _ in range(m):

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

        ab.append([a, b])

        g[a - 1].append(b - 1)

        g[b - 1].append(a - 1)

    ans = 0

    for i in range(n):

        check = True

        for j in g[i]:

            if h[j] >= h[i]:

                check = False

        if check:

            ans += 1



    print(ans)





if __name__ == "__main__":

    main()

def main():
    n, m = list(map(int, input().split()))
    h = list(map(int, input().split()))
    ab = []
    g = []
    for _ in range(n):
        g.append([])
    for _ in range(m):
        a, b = list(map(int, input().split()))
        ab.append([a, b])
        g[a - 1].append(b - 1)
        g[b - 1].append(a - 1)
    ans = 0
    for i in range(n):
        check = True
        for j in g[i]:
            if h[j] >= h[i]:
                check = False
        if check:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

def main():
    n, m = list(map(int, input().split()))
    h = list(map(int, input().split()))
    ab = []
    g = [[] for _ in range(n)]
    for _ in range(m):
        a, b = list(map(int, input().split()))
        ab.append([a, b])
        g[a - 1].append(b - 1)
        g[b - 1].append(a - 1)
    ans = 0
    for i in range(n):
        check = True
        for j in g[i]:
            if h[j] >= h[i]:
                check = False
        if check:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

-    g = [] -    for _ in range(n): -        g.append([]) +    g = [[] for _ in range(n)]