#include <stdio.h>
 
int main(void){
int N, M, H[100001], i, A[100001], B[100001] ;
int frag[100001]={0}, ans=0;

    scanf("%d %d",&N,&M); 

    for(i=1;i<=N;i=i+1){
       scanf("%d",&H[i]);
    }
    for(i=0;i<M;i=i+1){
       scanf("%d %d",&A[i],B[i]);
    }
    
    for(i=0;i<M;i=i+1){
       if(H[A[i]]>H[B[i]]){
         frag[B[i]]++;
       }
       else if(H[A[i]]<H[B[i]]){
         frag[A[i]]++;
       }
       else{
         frag[A[i]]++;
         frag[B[i]]++;
       }
    }

    for(i=1;i<=N;i=i+1){
       if(frag[i]==0){
         ans++;
       }
    }

printf("%d",ans);
}