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

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

ma = [0]*(n)

for i in range(m):

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

  ma[a] = max(ma[a], h[b])

  ma[b] = max(h[a], ma[b])

ans = 0

for i in range(n):

  if h[i]>ma[i]:

    ans+=1

print(ans)

def main():

    import sys

    def input(): return sys.stdin.readline().rstrip()

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

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

    height = [0]*n

    for i in range(m):

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

        height[a] = max(height[a], h[b])

        height[b] = max(height[b], h[a])

    

    count = 0

    for i, j in zip(h, height):

        if i > j:

            count += 1

    print(count)



if __name__ == '__main__':

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

def main():
    import sys

    def input():
        return sys.stdin.readline().rstrip()

    n, m = list(map(int, input().split()))
    h = list(map(int, input().split()))
    height = [0] * n
    for i in range(m):
        a, b = [int(x) - 1 for x in input().split()]
        height[a] = max(height[a], h[b])
        height[b] = max(height[b], h[a])
    count = 0
    for i, j in zip(h, height):
        if i > j:
            count += 1
    print(count)


if __name__ == "__main__":
    main()

-n, m = list(map(int, input().split())) -h = list(map(int, input().split())) -ma = [0] * (n) -for i in range(m): -    a, b = [int(x) - 1 for x in input().split()] -    ma[a] = max(ma[a], h[b]) -    ma[b] = max(h[a], ma[b]) -ans = 0 -for i in range(n): -    if h[i] > ma[i]: -        ans += 1 -print(ans) +def main(): +    import sys + +    def input(): +        return sys.stdin.readline().rstrip() + +    n, m = list(map(int, input().split())) +    h = list(map(int, input().split())) +    height = [0] * n +    for i in range(m): +        a, b = [int(x) - 1 for x in input().split()] +        height[a] = max(height[a], h[b]) +        height[b] = max(height[b], h[a]) +    count = 0 +    for i, j in zip(h, height): +        if i > j: +            count += 1 +    print(count) + + +if __name__ == "__main__": +    main()