#include<stdio.h>

int main(){

    int N,M;
    scanf("%d%d", &N, &M);

    int i,j;
    int H[100000+1] = {0};
    int flag[100000+1] = {0};
    int ans=0;
    int A,B;
    for( i = 1; i <= N; i++ ){
        scanf("%d", &H[i]);
    }

    for( i = 1; i <= M; i++ ){
        scanf("%d%d", &A, &B);

        if( H[A] == H[B] ) flag[A]++; flag[B]++;
        if( H[A] < H[B] )  flag[A]++;
        if( H[A] > H[B] )  flag[B]++;

    }
    
    for( i = 1; i <= N; i++ ){
        if( H[i] == 0 ) ans++;
    }

    printf("%d\n", ans);





    return 0;
}
