#include<stdio.h>

int main (void){

    long long N,M,a_val,b_val;
    long long ans=0;
    long long max=0;
    long long a[500][500];
    long long h[500];
    long long val;

    int it,iy,i,flag=0;
    char c;

    scanf("%lld %lld",&N,&M);
    scanf("%c",&c);

    for(i=0;i<N;i++){
        a[i][0]=0;
        scanf("%lld ",&h[i]);
    }

    for(i=0;i<M;i++){
        scanf("%lld %lld",&a_val,&b_val);
        scanf("%c",&c);

        val=a[a_val-1][0]+1;
        a[a_val-1][val]=b_val;
        a[a_val-1][0]++;

        val=a[b_val-1][0]+1;
        a[b_val-1][val]=a_val;
        a[b_val-1][0]++;

    }

    for(it=0;it<N;it++){
        max=h[it];
        flag=0;
        //printf("max %lld\n",max);
        //printf("%lld has %lld links\n",it+1,a[it][0]);
        if(a[it][0]==0){
            ans++;
            continue;
        }

        for(iy=1;iy<=a[it][0];iy++){
            val=a[it][iy];
            if(max <= h[ val-1 ]){
                flag=1;
                //printf("hval %d\n",h[val]);
                //printf("%lld is bad \n",it+1);
                break;
            }
        }

        if(flag==0){
            //printf("%d is good\n",it+1);
            ans++;
        }
    }

    printf("%lld",ans);

    return 0;
}