#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
const int INF = 0x3f3f3f3f;
int n, m, k;
vector<int> G[maxn];
int p[maxn];
bool vis[maxn];
int dis1[maxn], dis2[maxn];
bool cmp(int a, int b) { return dis1[a] - dis2[a] > dis1[b] - dis2[b]; }
void spfa(int dis[], int x) {
  for (int i = 1; i <= n; i++) dis[i] = INF, vis[i] = 0;
  queue<int> q;
  q.push(x);
  dis[x] = 0;
  vis[x] = 1;
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    vis[u] = 0;
    for (int i = 0; i < G[u].size(); i++) {
      int v = G[u][i];
      if (dis[v] > dis[u] + 1) {
        dis[v] = dis[u] + 1;
        if (!vis[v]) {
          q.push(v);
          vis[v] = 1;
        }
      }
    }
  }
}
int main() {
  cin >> n >> m >> k;
  for (int i = 1; i <= k; i++) cin >> p[i];
  for (int i = 1; i <= m; i++) {
    int u, v;
    cin >> u >> v;
    G[u].push_back(v);
    G[v].push_back(u);
  }
  spfa(dis1, 1);
  spfa(dis2, n);
  sort(p + 1, p + k + 1, cmp);
  int maxx = -INF, ans = 0;
  for (int i = 1; i <= k; i++) {
    ans = max(ans, dis1[p[i]] + maxx + 1);
    maxx = max(maxx, dis2[p[i]]);
  }
  cout << min(dis1[n], ans) << endl;
}
