#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main(){
  long N = 0, M = 0, A = 0, B = 0, d = 0, tenbo[100005] = { 0 }, H[100005] = { 0 }, ans = 0;
  scanf("%ld", &N);
  scanf("%ld", &M);
  ans = N;
  for (int i = 0; i < N; i++) scanf("%ld", H + i + 1);
  for (int i = 0; i < M; i++) {
    scanf("%ld %ld", &A, &B);
    if (H[A] >= H[B] && tenbo[B] == 0) {
      tenbo[B] = 1;
      ans--;
    }
    if (H[A] <= H[B] && tenbo[A] == 0) {
      tenbo[A] = 1;
      ans--;
    }
  }
  printf("%ld", ans);
  return 0;
}
