#include <stdio.h>

int main(void){
  int  n , m;
  scanf("%d  %d",&n,&m);
  
  int h[n+2];
  for(int i = 1;i <= n;i ++){
    scanf("%d",&h[i]);
  }

  int a[m+1] , b[m+1];
  for(int i = 0;i < m;i ++){
    scanf("%d %d",&a[i],&b[i]);
  }

  int count[100001] = {0} , ans = 0;
  
  for(int i = 0;i < m;i ++){
    if(h[a[i]] > h[b[i]]){
      count[b[i]] ++;
    }
    else if(h[a[i]] < h[b[i]]){
      count[a[i]] ++;
    }
    else if(h[a[i]] == h[b[i]]){
      count[a[i]] ++;
      count[b[i]] ++;
  }
  }
  
  for(int i = 1;i <= n; i ++){
    if(count[i]==0){
      ans ++;
    }
  }
  
  printf("%d",ans);
  
  return 0;
}
