#include <stdio.h>
#define N 100002

int main(void){
  int n,h[N],m,a,b,c[N]={0};
  int i,j,tmp,ans=0;
  
  scanf("%d %d", &n, &m);
  for(i=1;i<=n;i++){
    scanf("%d", &h[i]);
  }
  
  for(i=1;i<=m;i++){
    scanf("%d %d", &a,&b);
    if(c[a]<h[b]) c[a]=h[b];
    if(c[b]<h[a]) c[b]=h[a];
  }
  
  for(i=1;i<=n;i++){
    if(h[i]>c[i])ans++;
  }
  
  printf("%d", ans);
  
  return 0;
}