#include<stdio.h>
#include<stdlib.h>

int main(void) {
	
	int n, m, *t, ans = 0;
	long long int *h, *a, *b;

	t = malloc(sizeof(int) * 100001);
	h = malloc(sizeof(long long int) * 100001);
	a = malloc(sizeof(long long int) * 100001);
	b = malloc(sizeof(long long int) * 100001);

	scanf("%d%d", &n, &m);
	for (int i = 1; i <= n; i++) {
		scanf("%lld", &h[i]);
	}
	for (int i = 1; i <= m; i++) {
		scanf("%lld%lld", &a[i], &b[i]);
	}

	for (int i = 1; i <= n; i++) {
		t[i] = 0; 
	}

	for (int i = 1; i <= m; i++) {
		if (h[a[i]] < h[b[i]]) t[a[i]] = 1;
		else t[b[i]] = 1;
	}

	for (int i = 1; i <= n; i++) {
		if(t[i] == 0)ans++;
	}

	printf("%d", ans);

	return 0;
}