#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define REP(i, n) rep(i, 0, n)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define int long long
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
typedef pair<int, int> P;
const int mod = 1000000007;
const int INF = 1e12;

struct S{
    int to, cost;
    // S(int to, int cost): to(to), cost(cost){}
    bool operator>(const S &s) const{
        return cost > s.cost;
    }
};

int n, m, s, t;
int p[100010];
vector<S> G[100010];
int d[100010];

void dijkstra(int s){
    fill(d, d + n, INF);//V, INF
    d[s] = 0;
    priority_queue<P, vector<P>, greater<P> > q;
    q.push(P(d[s], s));
    while(!q.empty()){
        P p = q.top(); q.pop();
        int from = p.second;
        int cost = p.first;
        if(d[from] < cost) continue;
        rep(i, 0, G[from].size()){
            S e = G[from][i];
            int next = e.to;
            int newCost = e.cost + cost;
            if(d[next] > newCost){
                d[next] = newCost;
                q.push(P(newCost, next));
            }
        }
    }
}

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> n >> m >> s >> t;
    s--; t--;
    rep(i, 0, n){
        cin >> p[i];
    }
    rep(i, 0, m){
        int a, b;
        cin >> a >> b;
        a--; b--;
        G[a].push_back(S{b, p[b]});
    }
    rep(i, 1, n){
        G[i].push_back(S{i - 1, 0});
    }
    dijkstra(s);
    // for(int ii = 0; ii < n; ii++){
    //     if(ii) cout << ' ';
    //     cout << d[ii];
    // }
    // cout << endl;
    cout << d[t] << endl;
}