#include <stdio.h>

int main(void){
    long long int n,m;
    scanf("%lld%lld",&n,&m);
    long long int h[n];
    long long int a[m];
    long long int b[m];
    long long int count_m[n];
    long long int count_h[n][m];
    for(int i=0; i<n; i++){
        count_m[i]=0;
        for(int j=0; j<m; j++){
            count_h[i][j]=0;
        }
    }
    long long int ans=0;
    for(int i=0; i<n; i++){
        scanf("%lld",&h[i]);
    }
    for(int i=0; i<m; i++){
        scanf("%lld%lld",&a[i],&b[i]);
        count_h[a[i]-1][count_m[a[i]-1]]=b[i]-1;
        count_h[b[i]-1][count_m[b[i]-1]]=a[i]-1;
        count_m[a[i]-1]++;
        count_m[b[i]-1]++;
    }
    long long int f=0;
    for(int i=0; i<n; i++){
        f=0;
        if(count_m[i]==0){
            ans++;
        }else{
            for(int j=0; j<count_m[i]; j++){
                if(h[count_h[i][j]]>=h[i]){
                    f--;
                }
            }
            if(f==0){
                ans++;
            }
        }
    }
/*    for(int i=0; i<n; i++){
        printf("m:%d\n",count_m[i]);
    }
    for(int i=0; i<n; i++){
        for(int j=0; j<m; j++){
            printf("%d\t",count_h[i][j]);
        }
        printf("\n");
    }*/
    printf("%lld\n",ans);
    return 0;
}