import std.stdio, std.conv, std.string, std.algorithm,
       std.math, std.array, std.container, std.typecons;

void main() {
  long n, m;
  readf("%d %d\n", &n, &m);
  auto h = readln.chomp.split.to!(long[]);
  DList!long[] connected = new DList!long[n];
  for(long i=0; i<m; i++) {
    long a, b;
    readf("%d %d\n", &a, &b);
    a--; b--;
    connected[a].insert(b);
    connected[b].insert(a);
  }
  long count=0;
  for(long i=0; i<n; i++) {
    bool good = true;
    foreach(c;connected[i]) {
      good &= h[i] > h[c];
    }
    if(good) count++;
  }
  count.writeln;
}
