#include <stdio.h>

int main() {
	long int n, m, h[100000], dd[100000] = { 0 }, ans = 0;
	scanf("%ld%ld", &n, &m);
	for (int i = 0; i < n; i++) scanf("%ld", &h[i]);
	for (int i = 0; i < m; i++) {
		int s, t;
		scanf("%ld%ld", &s, &t);
		if (h[s - 1] >= h[t - 1])dd[t - 1]++;
		if (h[s - 1] <= h[t - 1])dd[s - 1]++;
	}
	for (int i = 0; i < n; i++)if (dd[i] == 0)ans++;
	printf("%ld", ans);
	return 0;
}