#include <bits/stdc++.h>
using namespace std;
struct Edge {
  int v, w, next;
} edge[2000000];
int mark[2000000], dis[2000000], vis[2000000], head[2000000];
int dis_1[2000000], dis_n[2000000], sp[2000000], sp_u[2000000], sp_v[2000000];
int n, m, k, t, i, j, u, v, res, resres, temp;
void Init() {
  memset(head, -1, sizeof(head));
  t = 0;
}
void Add_edge(int u, int v, int w) {
  edge[t].v = v;
  edge[t].w = w;
  edge[t].next = head[u];
  head[u] = t++;
}
void spfa(int st) {
  int i;
  for (i = 1; i <= n; i++) {
    mark[i] = 0;
    dis[i] = 10000000;
    vis[i] = 0;
  }
  queue<int> q;
  q.push(st);
  dis[st] = 0;
  vis[st] = 1;
  mark[st]++;
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    vis[u] = 0;
    for (int i = head[u]; i != -1; i = edge[i].next) {
      int v = edge[i].v;
      if (dis[v] > dis[u] + edge[i].w) {
        dis[v] = dis[u] + edge[i].w;
        if (!vis[v]) {
          q.push(v);
          mark[v]++;
          vis[v] = 1;
        }
        if (mark[v] >= n) return;
      }
    }
  }
  return;
}
bool cmp(const int &x, const int &y) {
  return dis_1[x] - dis_n[x] < dis_1[y] - dis_n[y];
}
int main() {
  cin >> n >> m >> k;
  for (i = 1; i <= k; i++) cin >> sp[i];
  Init();
  for (i = 1; i <= m; i++) {
    cin >> u >> v;
    Add_edge(u, v, 1);
    Add_edge(v, u, 1);
  }
  spfa(1);
  for (i = 1; i <= n; i++) dis_1[i] = dis[i];
  spfa(n);
  for (i = 1; i <= n; i++) dis_n[i] = dis[i];
  sort(sp + 1, sp + k + 1, cmp);
  int mx;
  mx = dis_n[sp[k]];
  for (i = k - 1; i >= 1; i--) {
    res = max(res, dis_1[sp[i]] + mx + 1);
    mx = max(mx, dis_n[sp[i]]);
  }
  cout << min(res, dis_1[n]) << endl;
  return 0;
}
