function main(input){
  input = input.split('\n');
  const [N, M] = input[0].split(' ').map(Number);
  const H = input[1].split(' ').map(Number);

  const map = {};
  for(let i=0; i<M; i++){
    const [a, b] = input[2 + i].split(' ').map(Number);
    if(!map[a]) map[a] = []
    if(!map[b]) map[b] = []
    map[a].push(b);
    map[b].push(a);
  }

  let count = 0;
  for(let i=1; i<=N; i++){
    const tonari = map[i];
    if(tonari && tonari.some(x => H[i-1] <= H[x-1])) continue;
    count++;
  }

  console.log(count);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim());
