#include <stdio.h>

typedef struct List {
	struct List *next;
	int v;
} list;

int main()
{
	int i, N, M, u, w, H[100001];
	list *adj[100001] = {}, e[200001];
	scanf("%d %d", &N, &M);
	for (i = 1; i <= N; i++) scanf("%d", &(H[i]));
	for (i = 0; i < M; i++) {
		scanf("%d %d", &u, &w);
		e[i*2].v = w;
		e[i*2+1].v = u;
		e[i*2].next = adj[u];
		e[i*2+1].next = adj[w];
		adj[u] = &(e[i*2]);
		adj[w] = &(e[i*2+1]);
	}
	
	int ans = 0;
	list *p;
	for (u = 1; u <= N; u++) {
		for (p = adj[u]; p != NULL; p = p->next) if (H[p->v] >= H[u]) break;
		if (p == NULL) ans++;
	}
	
	printf("%d\n", ans);
	fflush(stdout);
	return 0;
}