import java.util.Scanner

import scala.collection.mutable


object Main {

  def main(args: Array[String]): Unit = {

    val sc = new Scanner(System.in)
    val n = sc.nextInt() //temboudai
    val m = sc.nextInt() //road count

    val h = Vector.fill(n)(sc.nextInt()) //high
    val ab = Vector.fill(m)((sc.nextInt(), sc.nextInt())) //road


    def isIitemboudai(i: Int): Boolean = {
      val hi = h(i - 1)
      ab.forall { case (a, b) => (a, b)
      match {
        case (a, b) if (a == i) => h(b - 1) < hi
        case (a, b) if (b == i) => h(a - 1) < hi
        case _ => true
      }
      }
    }

    val ans = (1 to n).count(isIitemboudai)
    println(ans)

  }
}
