import kotlin.math.*
import java.util.*

fun main(args: Array<String>) {
  val (n, m) = readLine()!!.split(' ').map(String::toInt)
  val h = readLine()!!.split(' ').map(String::toInt)
  val ten = Array(n) { sortedSetOf<Int>() }
  repeat(m) {
    val (a, b) = readLine()!!.split(' ').map(String::toInt)
    ten[a - 1].add(h[b - 1])
    ten[b - 1].add(h[a - 1])
  }
  var ans = 0
  for ((i, t) in ten.withIndex()) {
    if (t.isEmpty() || t.last() < h[i]) ans++
  }
  println(ans)
}
