#include <iostream>
#include <vector>
#include <set>
using namespace std;

int main(){
  int N,M;
  cin >> N;
  cin >> M;

  vector<int> H(N);
  vector<bool> Good(N, true);

  for(int i = 0;i < N;i++){
    cin >> H[i];
  }

  for(int i = 0;i < M;i++){
    int a,b;
    cin >> a;
    cin >> b;
    a--;
    b--;
    Good[H[a] < H[b] ? a : b] = false;
  }

  int count = 0;
  for(int i = 0;i < N;i++){
    if(Good[i])
      count++;
  }  

  std::cout << count << std::endl;
}
