let nl = readLine()!.split(separator: " ").map { Int($0)! }
let n = nl[0], m = nl[1]
let hn = readLine()!.split(separator: " ").map { Int($0)! }
var ab = [[Int]](repeating: [Int](), count: n)

for _ in 0..<m {
  let abj = readLine()!.split(separator: " ").map { Int($0)! }
  ab[abj[0] - 1] = ab[abj[0] - 1] + [abj[1]]
  ab[abj[1] - 1] = ab[abj[1] - 1] + [abj[0]]
}
var cn = 0
for i in 0..<n {
  if let max = ab[i].max(by: { hn[$0 - 1] > hn[$1 - 1] }) {
    if hn[max - 1] < hn[i] {
      cn += 1
    }
  } else {
    cn += 1
  }
}
print(cn)