#include<stdio.h>
int main()
{
	int n,m,h[100000],a[100000],b[100000];
	int i,j,c=0,x[100000];
	scanf("%d %d",&n,&m);
	for(i=1;i<=n;i++){
		scanf("%d",&h[i]);
		x[i]=0;
	}
	for(i=1;i<=m;i++){
		scanf("%d %d",&a[i],&b[i]);
		if(h[a[i]]==h[b[i]]){
			x[a[i]]=1;
			x[b[i]]=1;
		}
		if(h[a[i]]>h[b[i]]){
			x[b[i]]=1;
		}
		if(h[a[i]]<h[b[i]]){
			x[a[i]]=1;
		}
	}
	for(i=1;i<=n;i++){
		if(x[i]==0){
			c++;
		}
	}
	printf("%d\n",c);
	return 0;
}