#include<stdio.h>
int main ()
{
    int n,m;
    scanf("%d %d",&n,&m);
    int e[n+5][n+5]={0};
    long long int h[n+5]={0};
    int book[n+5]={0};
    int tmp=n;
    while(tmp--)scanf("%lld",&h[n-tmp]);
    tmp=m;
    while(tmp--)
    {
        int a,b;
        scanf("%d %d",&a,&b);
        e[a][b]++;
        e[b][a]++;
    }
    int i,j,sum=0;
    for(i=1;i<=n;i++)
    {
        int flag=0;
        for(j=1;j<=n;j++)
        {
            if(e[i][j])
            {
                flag++;
                if(h[i]>h[j])
                {
                    book[i]++;
                    break;
                }
            }
        }
        if(flag==0)book[i]++;
    }
    for(i=1;i<=n;i++)if(book[i])sum++;
    printf("%d",sum);
    return 0;
}

