#include <stdio.h>

int main(void)
{
  int n, m;
  scanf("%d %d", &n, &m);

  int cnt = 0;
  int tmp;
  
  long h[n];
  int a[m], b[m];
  int at, bt;
  for (int i = 1; i <= n; i++) scanf("%ld", &h[i]);
  for (int i = 1; i <= m; i++) scanf("%d %d", &a[i], &b[i]);

  for (int i = 1; i <= n; i++){
    tmp = 0;
    for (int j = 1; j <= m; j++){
      if (h[i] == h[a[j]] && h[i] <= h[b[j]]) tmp++;
      else if (h[i] == h[b[j]] && h[i] <= h[a[j]]) tmp++;
    }
    if (tmp == 0) cnt++;
  }

  printf("%d", cnt);
  
}