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

int N, M;
int H[114514];

int ec[114514];
int* es[114514];

void ae(int f, int t) {
	es[f] = realloc(es[f], sizeof(*es[f]) * (ec[f] + 1));
	if (es[f] == NULL) exit(2);
	es[f][ec[f]++] = t;
}

int main(void) {
	int i, j;
	int count = 0;
	if (scanf("%d%d", &N, &M) != 2) return 1;
	for (i = 1; i <= N; i++) {
		if (scanf("%d", &H[i]) != 1) return 1;
	}
	for (i = 0; i < M; i++) {
		int A, B;
		if (scanf("%d%d", &A, &B) != 2) return 1;
		ae(A, B);
		ae(B, A);
	}
	for (i = 1; i <= N; i++) {
		int yes = 1;
		for (j = 0; j < ec[i]; j++) {
			if (H[i] <= H[es[i][j]]) yes = 0;
		}
		if (yes) count++;
	}
	printf("%d\n", count);
	return 0;
}
