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