import scala.io.StdIn._
object Main extends App {
  val Array(n, m, s, t) = readLine.trim.split(' ').map(_.toInt)
  val dimensions = Array.fill(n){Nil: List[Int]}
  val damages = readLine.trim.split(' ').map(_.toInt)
  val minDamage = Array.fill(n){Int.MaxValue}
  for (_ ← 0 until m){
    val Array(a, b) = readLine.trim.split(' ').map(_.toInt - 1)
    dimensions(a) ::= b
  }
  val minBit = MinBit(n).reversed
  minBit.decrease(s - 1, 0)
  minDamage(s - 1) = 0
  for (d ← 0 until t) {
    minDamage(d) = minBit(d)
    for (to ← dimensions(d)) {
      if (minDamage(to) > damages(to) + minDamage(d)) {
        minDamage(to) = damages(to) + minDamage(d)
        minBit.decrease(to, minDamage(to))
      }
    }
  }
  println(minDamage(t - 1))


}
trait MinBit {
  def apply(position: Int): Int
  def decrease(position: Int, newValue: Int): Unit
  def reversed: MinBit
  def size: Int
}
object MinBit {
  def apply(size: Int): MinBit = new MinBitImpl(size)
  private class MinBitImpl(val size: Int) extends MinBit {
    private val array = Array.fill(size){Int.MaxValue}
    def apply(position: Int): Int = {
      if (position >= 0) {
        Math.min(array(position), apply(position - ((position + 1) & ~position)))
      }else {
        Int.MaxValue
      }
    }
    def decrease(position: Int, newValue: Int): Unit = {
      if (position < size && array(position) > newValue) {
        array(position) = newValue
        decrease(position + ((position + 1) & ~position), newValue)
      }
    }
    override def reversed: MinBit = new Reversed(this)
  }
  private class Reversed(private val bit: MinBit) extends MinBit {
    def size = bit.size
    def apply(position: Int): Int = bit(size - position - 1)
    def decrease(position: Int, newValue: Int) = bit.decrease(size - position - 1, newValue)
    override def reversed: MinBit = bit
  }
}
