#include <stdio.h>

void minMax(int x, int y, int X, int Y, int* min, int* max) {
  if (x < y) {
    *min = X;
    *max = Y;
  } else {
    *min = Y;
    *max = X;
  }
}

int main(void) {
  int N, M;
  scanf("%d %d", &N, &M);
  int H[N];
  int good[N];
  for (int n = 0; n < N; ++n) {
    scanf("%d", &H[n]);
    good[n] = 1;
  }
  
  for (int m = 0; m < M; ++m) {
    int A, B;
    scanf("%d %d", &A,&B);
    --A; --B;
    
    if (H[A] < H[B]) {
      good[A] = 0;
    } else if (H[B] < H[A]) {
      good[B] = 0;
    } else {
      good[A] = good[B] = 0;
    }
  }
  
  int numGood = 0;
  for (int n = 0; n < N; ++n) {
    //fprintf(stderr, "good[%d] = %d\n", n+1, good[n]);
    if (good[n]) ++numGood;
  }
  printf("%d\n", numGood);
  
  return 0;
}