func input2() -> (Int, Int) {
    let s = readLine()!.split(separator: " ")
    return (Int(s[0])!, Int(s[1])!)
}

func input_ints() -> [Int] {
    return readLine()!.split(separator: " ").map{e in Int(e)!}
}

let (N, M) = input2()
let H = input_ints()
var ans = Array(repeating: true, count: N)

for _ in 0..<M {
    var (A, B) = input2()
    A -= 1
    B -= 1
    if H[A] <= H[B] {
        ans[A] = false
    }
    if H[B] <= H[A] {
        ans[B] = false
    }
}

let count = ans.filter{ e in e }.count
print(count)