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

#define rep(i,k,n) for(int (i)=(k);(i)<(n);(i)++)
#define max(a,b) (a)>(b)?(a):(b)
#define min(a,b) (a)<(b)?(a):(b)
#define abs(a,b) (a)< 0 ?(a):-(a)
#define llong long long

int main(){
	int N,M; scanf("%d %d",&N,&M);
	int H[N];
	rep(i,0,N) scanf("%d",&H[i]);
	int flag[N];
	rep(i,0,N) flag[i]=1;
	rep(i,0,M){
		int A,B; scanf("%d %d",&A,&B);
		A--; B--;
		if( H[A] <= H[B] ) flag[A]=0;
		if( H[B] <= H[A] ) flag[B]=0;
	}
	int ans=0;
	rep(i,0,N) if( flag[i] ) ans++;
	printf("%d",ans);
	return 0;
}
