#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long INF = 1e9 + 5;
const double eps = 1e-7;
const double PI = acos(-1.0);
inline void debug_vi(vector<int> a) {
  for (long long i = (long long)(0); i < (long long)(a.size()); i++)
    cout << a[i] << " ";
}
inline void debug_vll(vector<long long> a) {
  for (long long i = (long long)(0); i < (long long)(a.size()); i++)
    cout << a[i] << " ";
}
inline void print_case(int tn) { cout << "Case #" << tn << ": "; }
template <typename T>
using minpq = priority_queue<T, vector<T>, greater<T>>;
template <typename T>
using maxpq = priority_queue<T>;
const int nax = 2e5 + 5;
int n, m, k;
vector<int> g[nax];
int dist[nax], dist2[nax];
set<int> s;
void bfs(int src, int dist[]) {
  for (long long i = (long long)(0); i < (long long)(n); i++) dist[i] = -1;
  queue<int> q({src});
  dist[src] = 0;
  while (!q.empty()) {
    int curr = q.front();
    q.pop();
    for (int nxt : g[curr]) {
      if (dist[nxt] == -1) {
        dist[nxt] = dist[curr] + 1;
        q.push(nxt);
      }
    }
  }
}
bool cmp(int a, int b) { return dist[a] - dist2[a] < dist[b] - dist2[b]; }
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m >> k;
  vector<int> arr(k);
  for (long long i = (long long)(0); i < (long long)(k); i++) {
    cin >> arr[i];
    arr[i]--;
    s.insert(arr[i]);
  }
  int x, y;
  for (long long i = (long long)(0); i < (long long)(m); i++) {
    cin >> x >> y;
    x--;
    y--;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  bfs(0, dist);
  bfs(n - 1, dist2);
  for (long long i = (long long)(0); i < (long long)(n); i++) {
    if (s.count(i)) {
      for (int nxt : g[i]) {
        if (s.count(nxt)) {
          cout << dist[n - 1];
          return 0;
        }
      }
    }
  }
  sort((arr).begin(), (arr).end(), cmp);
  int res = -1, my = dist2[arr[k - 1]];
  for (long long i = (long long)(k - 2); i >= (long long)(0); i--) {
    res = max(res, 1 + dist[arr[i]] + my);
    my = max(my, dist2[arr[i]]);
  }
  res = min(res, dist[n - 1]);
  cout << res;
  return 0;
}
