#include<stdio.h>

int main(void)
{
	int a,b,N, M, sum = 0;
	long long int h[100001];
	int w[100001] = {0};
	scanf("%d %d", &N, &M);

	for (int i = 1;i<=N;i++) {
		scanf("%lld",&h[i]);
	}
	for (int i = 0;i < M;i++) {
		scanf("%d %d",&a,&b);
		if (h[a] < h[b])
			w[a]++;
		else
			w[b]++;
	}


	for (int i = 1;i <= N;i++) {
		if (w[i] == 0)sum++;
	}

	printf("%d", sum);

	return 0;
}