#include <stdio.h>

int main(void){
    int N,M;
    int H[100001];
    int flag[100001] = {};
    
    scanf("%d%d",&N,&M);
    
    for(int i = 1; i <= N; i++){
        scanf("%d",&H[i]);
    }
    
    for(int i = 0; i < M; i++){
        int A,B;
        scanf("%d%d",&A,&B);
        if(H[A] == H[B]){
            flag[A] = flag[B] = 1;
        }
        else if(H[A] > H[B]){
            flag[B] = 1;
        }
        else if(H[B] > H[A]){
            flag[A] = 1;
        }
    }
    
    int cnt = 0;
    for(int i = 1; i <= N; i++){
        if(flag[i] == 0){
            cnt++;
        }
    }
    
    printf("%d\n",cnt);
}