#include<stdio.h>
#define ll long long

typedef struct miti{
  long A,B;
}tunagu;

long hantei(tunagu a,ll hei[]){
  if(hei[a.A]<hei[a.B])return a.A;
  else if(hei[a.A]>hei[a.B])return a.B;
  else return 0;
};
  

int main(){
  long N,M,ans=0;
  scanf("%ld%ld",&N,&M);
  ll H[N+1];
  ll tow[100001]={};
  for(int j=1;j<=N;j++){
    scanf("%lld",&H[j]);
  };
  tunagu road[M];
  for(int i=0;i<M;i++){
    scanf("%ld%ld",&road[i].A,&road[i].B);
    if(hantei(road[i],H)==0){
      tow[road[i].A]++;
      tow[road[i].B]++;
    }
    else tow[hantei(road[i],H)]++;
  };
  for(int x=1;x<=N;x++)
    if(tow[x]==0)ans++;
  printf("%ld",ans);
};