let inp = readLine()!.split(separator: " ").map { Int($0)! }
let (N, M) = (inp[0], inp[1])
let Hs = readLine()!.split(separator: " ").map { Int($0)! }
let roads = (1...M).map { _ -> (Int, Int) in
    let s = readLine()!.split(separator: " ").map { Int($0)! }
    return (s[0], s[1])
}

var r = 0
hr: for (i, h) in Hs.enumerated() {
    for road in roads {
        if road.0 == i+1 {
            if Hs[road.1-1] >= h { continue hr }
        } else if road.1 == i+1 {
            if Hs[road.0-1] >= h { continue hr }
        }
    }
    r += 1
}

print(r)
