/*
 * FileName:     C
 * CreatedDate:  2020-05-03 20:57:31 +0900
 * LastModified: 2020-05-03 22:09:54 +0900
 */

#include <stdio.h>
#include <string.h>
int main(void){
    long int n,m;
    scanf("%ld %ld",&n,&m);
    long int h[n];
    long int color[n];
    memset(color,0,sizeof(color));
    for(long int i=0;i<n;i++){
        scanf("%ld",&h[i]);
    }
    long int matrix[n][n];
    memset(matrix,0,sizeof(matrix));
    for(long int i=0;i<m;i++){
        long int a,b;
        scanf("%ld %ld",&a,&b);
        matrix[a-1][b-1]=1;
        matrix[b-1][a-1]=1;
    }
    int flag=0;
    long int count=0;
    for(long int i=0;i<n;i++){
        flag=0;
        for(long int j=0;j<n;j++){
            if(matrix[i][j]==1&&h[i]<=h[j]&&color[j]!=1){
                flag=1;
                break;
            }
        }
        if(flag==0){
            count++;
            color[i]=1;
        }
    }
    printf("%ld\n",count);
    return 0;
}
