#include <bits/stdc++.h>
using namespace std;
struct nod {
  vector<int> vecini;
  bool special;
  int d1 = -1, dn = -1;
} nod[200005];
bool comp(pair<int, int> a, pair<int, int> b) {
  return a.first - a.second < b.first - b.second;
}
vector<pair<int, int>> v;
int maxx, len, n, m, k, i, x, y, ans;
void bfs(int poz) {
  queue<pair<int, int>> q;
  q.push({poz, 0});
  while (!q.empty()) {
    auto rn = q.front();
    q.pop();
    if (poz == 1) {
      if (nod[rn.first].d1 != -1) continue;
      nod[rn.first].d1 = rn.second;
    } else {
      if (nod[rn.first].dn != -1) continue;
      nod[rn.first].dn = rn.second;
    }
    for (auto it : nod[rn.first].vecini) q.push({it, rn.second + 1});
  }
}
bool lejer;
int main() {
  cin >> n >> m >> k;
  for (i = 1; i <= k; i++) {
    cin >> x;
    nod[x].special = true;
  }
  for (i = 1; i <= m; i++) {
    cin >> x >> y;
    if (nod[x].special && nod[y].special) lejer = true;
    nod[x].vecini.push_back(y);
    nod[y].vecini.push_back(x);
  }
  bfs(1);
  bfs(n);
  if (lejer) {
    cout << nod[n].d1;
    return 0;
  }
  for (i = 1; i <= n; i++) {
    if (nod[i].special) v.push_back({nod[i].d1, nod[i].dn});
  }
  len = v.size();
  sort(v.begin(), v.end(), comp);
  maxx = v[0].first;
  for (i = 1; i < len; i++) {
    ans = max(ans, v[i].second + maxx + 1);
    maxx = max(maxx, v[i].first);
  }
  cout << min(nod[n].d1, ans);
  return 0;
}
