#include <stdio.h>

#define int64 long long

int main()
{
  int64 nn, mm;
  scanf("%lld %lld", &nn, &mm);
  int64 hh[nn], data[nn][nn];
  for(int64 ii = 0;ii < nn;ii++)
  {
    for(int64 jj = 0;jj < nn;jj++)
    {
      data[ii][jj] = 0;
    }
    scanf("%lld", &hh[ii]);
  }
  int64 aa, bb;
  for(int64 ii = 0;ii < mm;ii++)
  {
    scanf("%lld %lld", &aa, &bb);
    data[aa - 1][bb - 1] = 1;
    data[bb - 1][aa - 1] = 1;
  }
  int64 ans = 0, flag;
  for(int64 ii = 0;ii < nn;ii++)
  {
    flag = 1;
    for(int64 jj = 0;jj< nn;jj++)
    {
      if(data[ii][jj])
      {
        if(hh[ii] <= hh[jj])
        {
          flag = 0;
          break;
        }
      }
    }
    if(flag)
    {
      ans++;
    }
  }
  printf("%lld", ans);
  return 0;
}