#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MIN(x,y) (((x) > (y)) ? (y) : (x))
#define ABS(x) ((x) >= 0 ? (x) : (-(x)))

int H[100000];
//int A[100000];
//int B[100000];
int X[100000];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%d", &H[i]);
    X[i] = 1;
  }
  for (int i = 0; i < m; i++) {
    int a, b;
    //scanf("%d%d", &A[i], &B[i]);
    scanf("%d%d", &a, &b);
    a -= 1;
    b -= 1;
    if (H[a] <= H[b]) {
      X[a] = 0;
    }
    if (H[b] <= H[a]) {
      X[b] = 0;
    }
  }
  int sum = 0;
  for (int i = 0; i < n; i++) {
    if (X[i]) {
      sum++;
    }
  }
  printf("%d", sum);

  return 0;
}