#include<stdio.h>

int main(){
    int N,K,count=0;
    scanf("%d %d ",&N,&K);
    int h[N],a[K],b[K],q[N];
    for(int i=0;i<N;i++){
        scanf("%d ",&h[i]);
        q[i]=0;
    }
    for(int i=0;i<K;i++){
        scanf("%d %d ",&a[i],&b[i]);
    }
    for(int i=0;i<K;i++){
        if(h[a[i]-1] <= h[b[i]-1]){
            q[a[i]-1]+=1;
        }
        if(h[b[i]-1] <=h[a[i]-1]){
            q[b[i]-1]+=1;
        }
    }
    for(int i=0;i<N;i++){
        if(q[i]==0) count+=1;
    }
    printf("%d",count);
    
    return 0;
}