#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
inline void smax(int &x, int y) { x = max(x, y); }
inline void smin(int &x, int y) { x = min(x, y); }
ll gcd(ll a, ll b) { return ((b == 0) ? a : gcd(b, a % b)); }
vector<vector<int> > gr;
int n, m, k;
vector<int> d1, dn;
void bfs(int s, vector<int> &d) {
  d.resize(n + 1, 1000000007);
  deque<int> pq;
  vector<int> vis(n + 1);
  d[s] = 0;
  vis[s] = 1;
  pq.push_back(s);
  while (pq.size()) {
    int x = pq.front();
    pq.pop_front();
    for (int i = 0; i < gr[x].size(); i++) {
      int y = gr[x][i];
      if (!vis[y]) {
        vis[y] = 1;
        pq.push_back(y);
        d[y] = d[x] + 1;
      }
    }
  }
}
bool myf(int x, int y) {
  if (d1[x] < d1[y]) return true;
  return false;
}
int32_t main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m >> k;
  gr.resize(n + 1);
  int f = 0;
  vector<int> sp(n + 1);
  for (__typeof(k) i = (0) - ((0) > (k)); i != (k) - ((0) > (k));
       i += 1 - 2 * ((0) > (k))) {
    int x;
    cin >> x;
    sp[x] = 1;
  }
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    gr[x].push_back(y);
    gr[y].push_back(x);
    if (sp[x] && sp[y]) f = 1;
  }
  bfs(1, d1);
  bfs(n, dn);
  if (f == 1) {
    cout << d1[n];
    exit(0);
  }
  vector<int> ds;
  for (int i = 1; i <= n; i++) {
    if (sp[i]) ds.push_back(i);
  }
  sort(ds.begin(), ds.end(), myf);
  multiset<int> all;
  for (int i = k - 1; i >= 0; i--) all.insert(dn[ds[i]]);
  int cur = 0;
  for (int i = 0; i < k; i++) {
    all.erase(all.find(dn[ds[i]]));
    if (all.size() > 0) {
      multiset<int>::iterator it = all.end();
      it--;
      cur = max(cur, *it + d1[ds[i]] + 1);
    }
  }
  cur = min(cur, d1[n]);
  cout << cur;
}
