#include<stdio.h>

int main(void){
    register int i;
    int n,m,a,b;
    scanf("%d%d",&n,&m);
    long h[n];
    _Bool highest[n];
    for(i = 0;i < n;i++){
	scanf("%ld",&h[i]);
	highest[i] = 1;
    }
    for(i = 0;i < m;i++){
        scanf("%d%d",&a,&b);
	a--;b--;
	if(h[a]==h[b]){
	    highest[a] = 0;
	    highest[b] = 0;
	    continue;
	}
	highest[h[a] < h[b] ? a : b] = 0;
    }
    int cnt = 0;
    for(i = 0;i < n;i++)if(highest[i])cnt++;
    printf("%d",cnt);
}
