#include "bits/stdc++.h" using namespace std; #define int long long using ll = long long; using P = pair; const ll INF = (1LL << 61); ll mod = (ll)1e9 + 7; int N; vectora; vector>G; bool seen[200010]; void dfs(int v) { seen[v] = true; for (auto nv : G[v]) { if (seen[nv])continue; dfs(nv); } } signed main() { ios::sync_with_stdio(false); cin.tie(0); cin >> N; a.resize(N); G.resize(N); ll M; cin >> M; ll S, T; cin >> S >> T; S--; T--; for (int i = 0; i < N; i++)cin >> a[i]; vectorans(N, true); for (int i = 0; i < N; i++) { if (a[i] >= a[S])ans[i] = false; } for (int i = 0; i < M; i++) { int u, v; cin >> u >> v; u--; v--; G[u].push_back(v); G[v].push_back(u); } dfs(S); for (int i = 0; i < N; i++) { if (!seen[i])ans[i] = false; } for (int i = 0; i < N; i++)seen[i] = false; dfs(T); for (int i = 0; i < N; i++) { if (!seen[i])ans[i] = false; } int cnt = 0; for (int i = 0; i < N; i++) { if (ans[i])cnt++; } cout << cnt << endl; return 0; }