#include<stdio.h>
int main(void)
{
    int n,m,count=0;
    scanf("%d%d",&n,&m);
    int h[n],a[m],b[m],trash[n];
    for(int i=0;i<n;i++)
    {
        scanf("%d",&h[i]);
        trash[i] = 0;
    }
    for(int i=0;i<m;i++)
    {
        scanf("%d%d",&a[i],&b[i]);
        if(h[a[i]-1] < h[b[i]-1])
        {
            trash[a[i]-1] = 1;
        }
        if(h[a[i]-1] > h[b[i]-1])
        {
            trash[b[i]-1] = 1;
        }
        if(h[a[i]-1] == h[b[i]-1])
        {
            trash[a[i]-1] = 1;
            trash[b[i]-1] = 1;
        }
    }
    for(int i=0;i<n;i++)
    {
        if(trash[i] == 0)
        {
            count++;
            printf("%d\n",i+1);
        }
    }
    printf("%d",count);

}