#include<stdio.h>
#include<stdlib.h>

int main(void)
{
    long n,m,h[100000],ab[100000][2],i,j,con[100001][100001]={0},
    ans=0,ifgood;

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

    for ( i = 1; i <= n; i++)
    {
        ifgood=1;
        j=1;
        while(j<=100000&&con[i][j]!=0)
        {
            if(h[con[i][j]]>=h[i]) ifgood=0;
            j++;
        }
        if(ifgood=1) ans++;
    }

    printf("%ld",ans);

    return 0;
}