#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main(){
  int unused __attribute__((unused));
  int i, j, max = 0, cnt = 0, flag = 0;
  int N, M, *c, *H, *A, *B, **linked;
  unused = scanf("%d %d", &N, &M);
  H = malloc(sizeof(int)*N);
  A = malloc(sizeof(int)*M);
  B = malloc(sizeof(int)*M);
  c = malloc(sizeof(int)*N);
  linked = malloc(sizeof(int *)*N);
  for(i=0; i<N; i++){
    linked[i] = malloc(sizeof(int)*N);
    for(j=0; j<N; j++) linked[i][j] = 0;
    c[i] = 0;
    unused = scanf("%d", &H[i]);
  }
  for(i=0; i<M; i++){
    unused = scanf("%d %d", &A[i], &B[i]);
    linked[A[i]-1][B[i]-1] = 1;
    linked[B[i]-1][A[i]-1] = 1;
    if(c[A[i]-1]==0) c[A[i]-1]++;
    if(c[B[i]-1]==0) c[B[i]-1]++;
  }

  for(i=0; i<N; i++){
    max = 0;
    for(j=i; j<N; j++){
      //printf("%d ", linked[i][j]);
      if(linked[i][j]==1 && max < fmax(H[i], H[j])){
        max = fmax(H[i], H[j]);
      }
    }
    //printf("\n");
    if(max < H[i]) cnt++;
    if(c[i]==0) cnt++;
  }
  printf("%d", cnt);
  return 0;
}