import java.io.PrintWriter
import kotlin.math.max

fun main() {
    val pw = PrintWriter(System.out)

    val (n, m) = readInputLine().split(" ").map { it.toInt() }

    val h = readInputLine().split(" ").map { it.toInt() }

    val maxHeight = IntArray(n)

    repeat(m) {
        val (a, b) = readInputLine().split(" ").map { it.toInt() - 1 }
        maxHeight[a] = max(maxHeight[a], h[b])
        maxHeight[b] = max(maxHeight[b], h[a])
    }

    var ans = 0

    repeat(n) {
        if (h[it] > maxHeight[it]) {
            ans++
        }
    }

    pw.println(ans)

    pw.flush()
}

fun readInputLine(): String {
    return readLine()!!
}
