#include <stdio.h>
int max(int p,int q){
    if(p>q) return p;
    else return q;
}
int main(void){
    int n,m,x,y,i,ans=0;
    scanf("%d%d",&n,&m);
    int a[n],h[n];
    for(i=0;i<n;i++){
        scanf("%d",&h[i]);
        a[i]=0;
    }
    for(i=0;i<m;i++){
        scanf("%d%d",&x,&y);
        a[x-1] = max(a[x-1],h[y-1]);
        a[y-1] = max(a[y-1],h[x-1]);
    }
    for(i=0;i<n;i++){
        if(h[i]>a[i]) ans++;
    }
    printf("%d",ans);
    return 0;
}