#include <stdio.h>

int main(void){
    int n,m;
    scanf("%d%d",&n,&m);
    int h[n];
    int a[m];
    int b[m];
    int count_m[n];
    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;
        }
    }
    int ans=0;
    for(int i=0; i<n; i++){
        scanf("%d",&h[i]);
    }
    for(int i=0; i<m; i++){
        scanf("%d%d",&a[i],&b[i]);
        count_h[a[i]-1][count_m[a[i]-1]]=b[i];
        count_h[b[i]-1][count_m[b[i]-1]]=a[i];
        count_m[a[i]-1]++;
        count_m[b[i]-1]++;
    }
    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(count_h[i][j]<h[i]){
                    f--;
                }
            }
            if(f==0){
                ans++;
            }
        }
    }
    printf("%d\n",ans);
    return 0;
}