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: false, count: n)
var arr: [Int] = []
for _ in 0..<m {
  let ab = readLine()!.split(separator: " ").map { Int($0)! }
  let a = ab[0] - 1, b = ab[1] - 1
  arr.append(a)
  arr.append(b)
  if h[b] < h[a] {
    if bool[b] { bool[b] = false }
    bool[a] = true
  }
  if h[a] < h[b] {
    if bool[a] { bool[a] = false }
    bool[b] = true
  }
}
let lonely = n - Set(arr).count
let result = bool.filter { $0 == true }.count
print(result + lonely)