# C - Peaks

def main():

    N, M, *HAB = list(map(int, open(0).read().split()))

    H, AB = [0] + HAB[:N], HAB[N:]

    good_observatories = set(range(1, N + 1))

    for a, b in zip(*[iter(AB)] * 2):

        if H[a] >= H[b]:

            good_observatories.discard(b)

        if H[b] >= H[a]:

            good_observatories.discard(a)

    print((len(good_observatories)))





if __name__ == "__main__":

    main()

# C - Peaks

def main():

    N, M, *HAB = list(map(int, open(0).read().split()))

    H, AB = [0] + HAB[:N], HAB[N:]

    is_good = [False] + [True] * N

    for a, b in zip(*[iter(AB)] * 2):

        if H[a] >= H[b]:

            is_good[b] = False

        if H[b] >= H[a]:

            is_good[a] = False

    print((sum(is_good)))





if __name__ == "__main__":

    main()

# C - Peaks
def main():
    N, M, *HAB = list(map(int, open(0).read().split()))
    H, AB = [0] + HAB[:N], HAB[N:]
    good_observatories = set(range(1, N + 1))
    for a, b in zip(*[iter(AB)] * 2):
        if H[a] >= H[b]:
            good_observatories.discard(b)
        if H[b] >= H[a]:
            good_observatories.discard(a)
    print((len(good_observatories)))


if __name__ == "__main__":
    main()

# C - Peaks
def main():
    N, M, *HAB = list(map(int, open(0).read().split()))
    H, AB = [0] + HAB[:N], HAB[N:]
    is_good = [False] + [True] * N
    for a, b in zip(*[iter(AB)] * 2):
        if H[a] >= H[b]:
            is_good[b] = False
        if H[b] >= H[a]:
            is_good[a] = False
    print((sum(is_good)))


if __name__ == "__main__":
    main()

-    good_observatories = set(range(1, N + 1)) +    is_good = [False] + [True] * N -            good_observatories.discard(b) +            is_good[b] = False -            good_observatories.discard(a) -    print((len(good_observatories))) +            is_good[a] = False +    print((sum(is_good)))