#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long linf = (1ll << 62) - 1;
const int N = 3e5 + 7;
const int mod = 1e9 + 7;
const double eps = 1e-12;
template <typename T>
inline void rd(T &x) {
  char c;
  int sign = 1;
  x = 0;
  do {
    c = getchar();
    if (c == '-') sign = -1;
  } while (c < '0' || c > '9');
  do {
    x = x * 10 + c - '0';
    c = getchar();
  } while (c >= '0' && c <= '9');
  x *= sign;
}
int d1[N], d2[N], h[N], n, m, k;
struct edge {
  int to, w, next;
} e[N << 1];
struct dd {
  int h1, y;
};
int tot = 0, head[N];
void add(int x, int y, int w) {
  e[tot] = (edge){y, w, head[x]};
  head[x] = tot++;
}
void bfs(int t, int *d) {
  queue<int> q;
  q.push(t);
  d[t] = 0;
  while (!q.empty()) {
    int x = q.front();
    q.pop();
    for (int i = head[x]; ~i; i = e[i].next) {
      int y = e[i].to;
      if (d[y] != -1) continue;
      d[y] = d[x] + 1;
      q.push(y);
    }
  }
}
bool cmp(int i, int j) { return d1[i] - d2[i] < d1[j] - d2[j]; }
int main() {
  memset(head, -1, sizeof(head));
  memset(d1, -1, sizeof(d1));
  memset(d2, -1, sizeof(d2));
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= k; ++i) scanf("%d", &h[i]);
  for (int i = 1; i <= m; ++i) {
    int x, y;
    scanf("%d%d", &x, &y);
    add(x, y, 1);
    add(y, x, 1);
  }
  bfs(1, d1);
  bfs(n, d2);
  sort(h + 1, h + 1 + k, cmp);
  int mx = d1[h[1]], ans = -1;
  for (int i = 2; i <= k; ++i) {
    ans = max(ans, d2[h[i]] + mx + 1);
    mx = max(mx, d1[h[i]]);
  }
  printf("%d\n", min(ans, d1[n]));
  return 0;
}
