#include <stdio.h>
#include <stdlib.h>
int main(){
  long int N,M,i,count,tmp,A,B;
  long int X[100001],H[100001];
  for(i=0;i<100001;i++) X[i]=0;
  scanf("%ld %ld",&N,&M);
  count=N;
  for(i=0;i<N;i++){
   scanf("%ld",&H[i]);
  }
  for(i=0;i<M;i++){
    scanf("%ld %ld",&A,&B);
    if(H[A-1]>H[B-1] && X[B-1]==0){
      X[B-1]=1;
      count--;
    }
    else if(H[A-1]<H[B-1] && X[A-1]==0){
      X[A-1]=1;
      count--;
    }
    else if(H[A-1]==H[B-1]){
      if(X[A-1]==0 && X[B-1]==0) count=count-2;
      else if(X[A-1]==0 || X[B-1]==0) count--;
      X[A-1]=1;
      X[B-1]=1;
    }
  }
  printf("%ld",count);
  return 0;
}