#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
#define MAX_N 100005
struct edge{ int to,cost; };
int N,M,si,ti;
vector< edge > G[MAX_N];
int A[MAX_N];

int main(){
  cin>>N>>M>>si>>ti;
  si--,ti--;
  
  for(int i=0;i<N;i++){
    cin>>A[i];
    if(i){
      G[i].push_back( (edge){i-1,0} );
    }
  }
  for(int i=0;i<M;i++){
    int x,y;
    cin>>x>>y;
    x--,y--;
    G[x].push_back( (edge){y,A[y]} );
  }

  priority_queue< P , vector<P> , greater<P> > Q;
  int d[MAX_N];
  for(int i=0;i<MAX_N;i++)d[i]=1e9;
  
  Q.push( P(0,si) );
  d[si]=0;
  while(!Q.empty()){
    P p=Q.top();Q.pop();
    int pos=p.second;
    int cost=p.first;
    if(d[pos]<cost)continue;
    
    for(int i=0;i<(int)G[pos].size();i++){
      edge e=G[pos][i];
      if(e.cost+cost < d[e.to]){
        d[e.to]=e.cost+cost;
        Q.push( P(d[e.to],e.to) );
      }
    }
  }
  cout<< d[ti] <<endl;
  return 0;
}