#include<stdio.h>

int main(void){
    int N,M,i;
    scanf("%d %d",&N,&M);
    int H[N],A[M],B[M],judge[N];
    for(i=0;i<N;i++){
        scanf("%d",&H[i]);
        judge[i]=1;
    }
    for(i=0;i<M;i++){
        scanf("%d%d",&A[i],&B[i]);
        if(H[A[i]-1]>H[B[i]-1]){
            judge[B[i]-1]=0;
        }else{
            if(H[A[i]-1]<H[B[i]-1]){
                judge[A[i]-1]=0;
            }else{
                judge[A[i]-1]=0;
                judge[B[i]-1]=0;
            }
        }
    }
    int ans=0;
    for(i=0;i<N;i++){
        if(judge[i]==1){
            ans++;
        }
    }
    printf("%d\n",ans);
    return 0;
}