#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << ": " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int t2, t1, n, m, k;
  cin >> n >> m >> k;
  bool s[n + 1];
  memset(s, 0, sizeof(s));
  vector<int> ad[n + 1];
  int ma = 1;
  int a[n + 1];
  bool v[n + 1];
  memset(a, 0, sizeof(a));
  memset(v, 0, sizeof(v));
  for (long long i = 0; i < k; i++) {
    cin >> t1;
    s[t1] = 1;
  }
  for (long long i = 0; i < m; i++) {
    cin >> t1 >> t2;
    ad[t1].push_back(t2);
    ad[t2].push_back(t1);
  }
  set<pair<int, int> > q1;
  int c1 = 1, c2 = 0, l = 0;
  queue<int> q;
  q.push(1);
  v[1] = 1;
  while (!q.empty()) {
    c2 = 0;
    for (long long i = 0; i < c1; i++) {
      t1 = q.front();
      q.pop();
      a[t1] = l;
      if (s[t1]) q1.insert({l, t1});
      for (long long j = 0; j < ad[t1].size(); j++) {
        if (!v[ad[t1][j]]) {
          q.push(ad[t1][j]);
          v[ad[t1][j]] = 1;
          c2++;
        }
      }
    }
    c1 = c2;
    l++;
  }
  memset(v, 0, sizeof(v));
  q.push(n);
  v[n] = 1;
  l = 0;
  c1 = 1;
  c2 = 0;
  set<pair<int, int> >::iterator it;
  while (!q.empty()) {
    c2 = 0;
    for (long long i = 0; i < c1; i++) {
      t1 = q.front();
      q.pop();
      it = q1.lower_bound({a[t1], t1});
      if (it != q1.end() && it->second == t1) q1.erase(it);
      if (s[t1]) {
        if (!q1.empty() && ma < q1.rbegin()->first + 1 + l) {
          ma = q1.rbegin()->first + 1 + l;
        }
      }
      for (long long j = 0; j < ad[t1].size(); j++) {
        if (!v[ad[t1][j]]) {
          q.push(ad[t1][j]);
          v[ad[t1][j]] = 1;
          c2++;
        }
      }
    }
    c1 = c2;
    l++;
  }
  __f("ma, a[n]", ma, a[n]);
  cout << min(ma, a[n]) << "\n";
  return 0;
}
