'use strict'

function main(input) {
  const inputList = input.split('\n');
  const n = Number(inputList[0].split(' ')[0])
  const m = Number(inputList[0].split(' ')[1])
  const heightList = inputList[1].split(' ').map(height => Number(height))
  const routeList = inputList.slice(2)

  let list = new Array(n)
  for (let i=0; i<n; i++) {
    list[i] = new Array()
  }
  for (let i=0; i<m; i++) {
    const tmp = routeList[i].split(' ')
    const a = Number(tmp[0]) - 1
    const b = Number(tmp[1]) - 1
    list[a].push(b)
    list[b].push(a)
  }

  let count = 0
  for (let i=0; i<list.length; i++) {
    let tmp = 1
    for (let j=0; j<list[i].length; j++) {
      if (heightList[i] <= heightList[list[i][j]]) {
        tmp = 0
        break
      }
    }
    count += tmp
  }

  console.log(count)
}

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