#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 9;
int dis[N][2];
int a[N];
int n, m, k;
pair<int, int> b1[N], b2[N];
vector<int> G[N];
void dij(int s, int id) {
  dis[s][id] = 0;
  for (int i = 1; i <= n; ++i) {
    if (i == s) continue;
    dis[i][id] = 0x3f3f3f3f;
  }
  priority_queue<pair<int, int>, vector<pair<int, int> >,
                 greater<pair<int, int> > >
      q;
  q.push({0, s});
  while (!q.empty()) {
    int u = q.top().second;
    int d = q.top().first;
    q.pop();
    if (d > dis[u][id]) continue;
    dis[u][id] = min(dis[u][id], d);
    for (int i = 0; i < G[u].size(); ++i) {
      int v = G[u][i];
      if (dis[v][id] > dis[u][id] + 1) {
        dis[v][id] = dis[u][id] + 1;
        q.push({dis[v][id], v});
      }
    }
  }
}
int main() {
  scanf("%d %d %d", &n, &m, &k);
  for (int i = 1; i <= k; ++i) scanf("%d", a + i);
  for (int i = 1; i <= m; ++i) {
    int u, v;
    scanf("%d %d", &u, &v);
    G[u].push_back(v);
    G[v].push_back(u);
  }
  dij(1, 0);
  int ans = dis[n][0];
  dij(n, 1);
  int ans1 = -0x3f3f3f3f;
  for (int i = 1; i <= k; ++i) b1[i] = {dis[a[i]][0], a[i]};
  sort(b1 + 1, b1 + 1 + k);
  for (int i = 1; i <= k; ++i) b2[i] = {dis[a[i]][1], a[i]};
  sort(b2 + 1, b2 + 1 + k);
  for (int i = 1; i <= k; ++i) {
    int p = lower_bound(b1 + 1, b1 + 1 + k, make_pair(dis[a[i]][0], a[i])) - b1;
    if (p > 1) ans1 = max(ans1, b1[p - 1].first + dis[a[i]][1] + 1);
  }
  printf("%d", min(ans, ans1));
}
