import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = {
    //nextLineとnextを同時に使ったら死ぬ
    val sc = new Scanner(System.in)

    val n, m = sc.nextInt()
    val hs = Array.fill(n)(sc.nextInt())
    val map = Array.fill(n)(Set.empty[Int])

    (0 until m).foreach { _ =>
      val a, b = sc.nextInt()
      map(a - 1) = map(a - 1) + (b - 1)
      map(b - 1) = map(b - 1) + (a - 1)
    }

    var ans = 0L

    hs.zipWithIndex.foreach {
      case (elem, index) =>
        if (map(index).isEmpty) ans += 1
        else if (elem > map(index).map(j => hs(j)).max) ans += 1
    }

    println(ans)

  }

  def debug(args: Any*): Unit = {
    Console.err.println(args.mkString(" "))
  }

  def printExecTime(process: => Unit): Unit = {
    val start = System.currentTimeMillis
    process
    debug("処理時間： " + (System.currentTimeMillis - start) + " ミリ秒")
  }

}
