function Main(input){
  input = input.trim().split('\n').map(x=>(x.split(' ').map(y=>parseInt(y))));
  var n = input[0][0];
  var m = input[0][1];
  var heights = input[1];
  var good = Array(n).fill(1);
  for (let i=0;i<m;i++){
    var mts = input[i+2];
    if (heights[mts[0] - 1] <= heights[mts[1] - 1]){
      good[mts[0] - 1] = 0;
    }
    if (heights[mts[1] - 1] <= heights[mts[0] - 1]){
      good[mts[1] - 1] = 0;
    }
  }
  var ans = 0;
  for (let i=0;i<n;i++){
    if (good[i] == 1){
      ans++;
    }
  }
  console.log(ans);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
