#include<stdio.h>
int main() {
  int i,n,m,h[100002],ma[100002];

  scanf("%d %d",&n,&m);

  int a[m + 1],b[m + 1];
  
  for (i = 1;i <= n;i ++) {
    int height;
    scanf("%d",&height);
    h[i] = height;
    ma[i] = 0;
  }

  for (i = 1;i <= m;i ++) {
    int scana,scanb;
    scanf("%d %d",&scana,&scanb);
    a[i] = scana;
    b[i] = scanb;
  }
  for (i = 1;i <= m;i ++) {
    if (ma[a[i]] <= h[b[i]]) {
      ma[a[i]] = h[b[i]];
    }
    if (ma[b[i]] <= h[a[i]]) {
      ma[b[i]] = h[a[i]];
    }
  }
  int x = 0;
  for (i = 1;i <= n;i ++) {
    if (h[i] > ma[i]) {
      x ++;
    }
  }
  printf("%d",x);
}
