let nm = readLine()!.split(separator: " ").map { Int($0)! }
let n = nm[0], m = nm[1]
let h = readLine()!.split(separator: " ").map { Int($0)! }

var bool = Array(repeating: true, count: n)
for _ in 0..<m {
  let ab = readLine()!.split(separator: " ").map { Int($0)! }
  let a = ab[0] - 1, b = ab[1] - 1
  if bool[a] {
    bool[a] = !(h[a] < h[b])
  }
  if h[a] == h[b] {
    bool[a] = false
    bool[b] = false
  }
}
let result = bool.filter { $0 == true }.count
print(result)