func_code_string: #include <bits/stdc++.h>   using namespace std;   const int int_inf = 0x3f3f3f3f;   const long long int ll_inf = 0x3f3f3f3f3f3f3f3f;   const int max_n = 1e5 + 5;   bool g[max_n];   int head[max_n], nxt[max_n << 2], to[max_n << 2], cnt;   int dis[max_n];   int n, start, end1;   struct nodes {     int dis, v;     bool operator<(const struct nodes a) const { return dis > a.dis; }   };   void add(int a, int b) {     nxt[++cnt] = head[a];     head[a] = cnt;     to[cnt] = b;     return;   }   int max1;   void dijkstra() {     int i;     for (i = 0; i <= n; i++) dis[i] = int_inf;     dis[start] = 0;     priority_queue<nodes> q;     q.push((nodes){0, start});     while (!q.empty()) {       nodes t = q.top();       q.pop();       if (t.dis > dis[t.v]) continue;       dis[t.v] = t.dis;       max1 = max(max1, t.dis);       int tdis = t.dis + 1;       if (g[t.v]) tdis = 1;       if (t.v == end1) break;       for (i = head[t.v]; i; i = nxt[i]) {         if (tdis < dis[to[i]]) {           dis[to[i]] = tdis;           q.push((nodes){tdis, to[i]});         }       }     }     return;   }   int main() {     ios::sync_with_stdio(false);     cin.tie(0);     int i, j;     int m, k;     cin >> n >> m >> k;     for (i = 0; i < k; i++) {       int num;       cin >> num;       g[num] = true;     }     while (m--) {       int a, b;       cin >> a >> b;       add(a, b);       add(b, a);     }     cin >> start >> end1;     if (!g[start]) {       if (start == end1)         cout << 0 << endl;       else         cout << -1 << endl;     } else {       max1 = -1;       dijkstra();       cout << ((dis[end1] == int_inf) ? -1 : max1) << endl;     }     return 0;   }   