#include <stdio.h>

int main(void){

    long n, m;
    scanf("%ld %ld", &n, &m);

    long h[n];
    for(long i=0;i<n;i++){
        scanf("%ld", &h[i]);
    }

    long a, b;
    long bridge[n][n];
    for(long i=0;i<n;i++){
        for(long j=0;j<n;j++){
            bridge[i][j] = -1;
        }
    }
    for(long i=0;i<m;i++){
        scanf("%ld %ld", &a, &b);
        bridge[a-1][b-1] = h[b-1] - h[a-1];
        bridge[b-1][a-1] = h[a-1] - h[b-1];
    }

    long bad = 0;
    for(long i=0;i<n;i++){
        for(long j=0;j<n;j++){
            if(bridge[i][j]>=0){
               bad++;
               break;
            }
        }
    }

    printf("%ld\n", (n-bad));

    return 0;
}