#include <bits/stdc++.h>
using namespace std;
void __print(int x) { cout << x; }
void __print(long x) { cout << x; }
void __print(long long x) { cout << x; }
void __print(unsigned x) { cout << x; }
void __print(unsigned long x) { cout << x; }
void __print(unsigned long long x) { cout << x; }
void __print(float x) { cout << x; }
void __print(double x) { cout << x; }
void __print(long double x) { cout << x; }
void __print(char x) { cout << '\'' << x << '\''; }
void __print(const char *x) { cout << '\"' << x << '\"'; }
void __print(const string &x) { cout << '\"' << x << '\"'; }
void __print(bool x) { cout << (x ? "true" : "false"); }
template <typename T, typename V>
void __print(const pair<T, V> &x) {
  __print(x.first);
  cout << ',';
  __print(x.second);
}
template <typename T>
void __print(const T &x) {
  int f = 0;
  for (auto &i : x) cout << (f++ ? "," : ""), __print(i);
}
void _print() { cout << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
  __print(t);
  if (sizeof...(v)) cout << ", ";
  _print(v...);
}
const long long N = 2e5 + 7;
const long long MOD = 998244353;
vector<vector<pair<long long, long long>>> g(N);
vector<long long> dist(N, INT_MAX);
priority_queue<pair<long long, long long>, vector<pair<long long, long long>>,
               greater<pair<long long, long long>>>
    q;
void dijkstra(long long src) {
  dist[src] = 0;
  q.push(make_pair(0, src));
  vector<bool> vis(N, false);
  while (!q.empty()) {
    long long u = q.top().second;
    q.pop();
    if (vis[u]) continue;
    vis[u] = true;
    for (auto it : g[u]) {
      long long v = it.first;
      long long w = it.second;
      if (dist[v] > dist[u] + w) {
        dist[v] = dist[u] + w;
        q.push(make_pair(dist[v], v));
      }
    }
  }
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, m, k, u, v;
  cin >> n >> m >> k;
  g.resize(n);
  dist.resize(n);
  vector<long long> spec(k);
  for (long long i = 0; i < k; i++) cin >> spec[i], spec[i]--;
  for (long long i = 0; i < m; i++) {
    cin >> u >> v;
    u--, v--;
    g[u].emplace_back(v, 1);
    g[v].emplace_back(u, 1);
  }
  dijkstra(0);
  vector<long long> dist1 = dist;
  dist = vector<long long>(n, INT_MAX);
  dijkstra(n - 1);
  vector<long long> dist2 = dist;
  vector<pair<long long, long long>> vv;
  for (long long i = 0; i < k; i++) {
    vv.emplace_back(dist1[spec[i]] - dist2[spec[i]], spec[i]);
  }
  sort(vv.begin(), vv.end());
  long long d = 0, mx = -INT_MAX;
  for (auto it : vv) {
    d = max(d, mx + dist2[it.second]);
    mx = max(mx, dist1[it.second]);
  }
  cout << min(dist1[n - 1], d + 1);
  return 0;
}
