#include <bits/stdc++.h>
using namespace std;
int n, m, k, a[202020], tr[202020];
vector<int> v[202020];
void add(int p, int vl) {
  while (p < n) {
    tr[p] += vl;
    p |= p + 1;
  }
}
int gtt(int p) {
  int vl = 0;
  while (p >= 0) {
    vl += tr[p];
    p = (p & (p + 1)) - 1;
  }
  return vl;
}
bool ck(vector<pair<int, int> > aa, vector<pair<int, int> > b, int nd) {
  long long cnt = 0;
  int j = b.size() - 1;
  memset(tr, 0, sizeof(tr));
  for (int i = 0; i < aa.size(); i++) {
    while (j >= 0 && aa[i].first + b[j].first >= nd) {
      add(min(nd, b[j].second), 1);
      j--;
    }
    cnt += gtt(nd) - gtt(nd - aa[i].second - 1);
  }
  for (int i = 0; i < aa.size(); i++) {
    if (aa[i].first + aa[i].second >= nd) {
      cnt--;
    }
  }
  return cnt > 0;
}
vector<int> gt(int st) {
  vector<int> dt;
  for (int i = 0; i < n; i++) {
    dt.push_back(-1);
  }
  queue<int> q;
  q.push(st);
  dt[st] = 0;
  while (!q.empty()) {
    int x = q.front();
    q.pop();
    for (int i = 0; i < v[x].size(); i++) {
      if (dt[v[x][i]] != -1) {
        continue;
      }
      dt[v[x][i]] = dt[x] + 1;
      q.push(v[x][i]);
    }
  }
  return dt;
}
int main() {
  cin >> n >> m >> k;
  for (int i = 0; i < k; i++) {
    cin >> a[i];
    a[i]--;
  }
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  vector<int> d0 = gt(0), d1 = gt(n - 1);
  vector<pair<int, int> > v1, v2;
  for (int i = 0; i < k; i++) {
    v1.push_back(make_pair(d0[a[i]], d1[a[i]]));
    v2.push_back(make_pair(d1[a[i]], d0[a[i]]));
  }
  sort(v1.begin(), v1.end());
  sort(v2.begin(), v2.end());
  int l = 0, r = n + 2;
  while (r > l + 1) {
    int mid = (l + r) / 2;
    if (ck(v1, v2, mid)) {
      l = mid;
    } else {
      r = mid;
    }
  }
  cout << min(d1[0], r) << endl;
  return 0;
}
