#include<stdio.h>


int main(void) {
	int n, m, i,count=0;
	int h[100000], a[100000], b[100000], max[100000] = {};
	scanf("%d %d", &n, &m);
	for (i = 0; i < n; i++) {
		scanf("%d", &h[i]);
	}
	for (i = 0; i < m; i++) {
		scanf("%d %d\n", &a[i], &b[i]);
		if (max[a[i]-1] < h[b[i]-1]) max[a[i]-1] = h[b[i]-1];
		if (max[b[i]-1] < h[a[i]-1]) max[b[i]-1] = h[a[i]-1];
	}
	for (i = 0; i < n; i++) {
		if (max[i] < h[i]) count++;
	}
	printf("%d", count);

	return 0;
}