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

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

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