function Main(input){
  input = input.trim().split('\n').map(x=>(x.split(' ').map(y=>parseInt(y))));
  var ans = 0;
  for (i=0;i<input[0][0];i++){
    var h = input[1][i];
    var ok = 1;
    for (j=0;j<input[0][1];j++){
      if (input[j+2][0] == i+1){
        var vs = input[j+2][1];
      }else if (input[j+2][1] == i+1){
        var vs = input[j+2][0];
      }
      if (input[1][vs-1] >= h){
        ok = 0;
        break;
      }
    }
    if (ok == 1){
      ans += 1;
    }
  }
  console.log(ans);
}

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