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

typedef struct
{
	int A;
	int B;
}integer;

int main()
{
  int N , M;
  scanf("%d %d",&N,&M);
  int H[N+1];
  H[0]=0;

  for (int i =1;i<=N;i++)
  {
  	scanf("%d",&H[i]);
  }

  integer Road[M+1];

  for (int i = 1;i<=M;i++)
  {
  	scanf("%d %d",&Road[i].A,&Road[i].B);
  }

  int Counters[N+1];
  for (int i = 1;i<=N;i++)
  {
    Counters[i]=5;
  }

  int count = 0;
  for (int i = 1;i<=M;i++)
  {
  	if (H[	Road[i].A	] >= H[Road[i].B])Counters[Road[i].A]*=2;
	  else Counters[Road[i].A]*=0;

  }

  for (int i = 1;i<=M;i++)
  {
  	if (H[	Road[i].B	] >= H[Road[i].A])Counters[Road[i].B]*=2;
	  else Counters[Road[i].A]*=0;
  }

  for (int i = 1;i<=N;i++)
  { 
	  if (Counters[i]>=10)
  	   count++;
  }

  printf("%d",count);
   return 0;
}
