#include<stdio.h>
int main(){
  int i,A,B,N,M,ans;
  ans=0;
  scanf("%d%d",&N,&M);
  int H[N],judge[N];
  for(i=0;i<N;i++){
    scanf("%d",&H[i]);
    judge[i]=0;
  }
  for(i=0;i<M;i++){
    scanf("%d%d",&A,&B);
    if(H[A-1]>H[B-1])
      judge[B-1]=1;
    else if(H[A-1]==H[B-1]){
      judge[A-1]=1;
      judge[B-1]=1;
    }
    else
      judge[A-1]=1;
  }
  for(i=0;i<N;i++){
    if(judge[i]==0)
      ans++;
  }
  printf("%d\n",ans);
  return 0;
}