#include <bits/stdc++.h>

using namespace std;

int h,w,a,b;

long long dp[(1 << 17) + 10][20];

long long f(int mask, int da) {
   
    if(da == a)  
        return 1;

    long long &ans = dp[mask][da];
    if(ans != -1) return ans;

    ans = 0;

    for (int i = 0; i < h; ++i) {
        for (int j = 0; j < w; ++j) {
            int pos = w * i + j;
            int next = w * i + j + 1;
            if(!(mask & (1 << pos)) and j + 1 < w and !(mask & (1 << next))) {
                ans += f(mask | (1 << pos) | (1 << next), da + 1);
            }
            next = w * (i + 1) + j;
            if(!(mask & (1 << pos)) and i + 1 < h and !(mask & (1 << next))) {
                ans += f(mask | (1 << pos) | (1 << next), da + 1);
            }
        }
    }
    return ans;
}

int main() {
    memset(dp, -1, sizeof dp);
    cin >> h >> w >> a >> b;

    long long ft = 1;

    for (int i = 1; i <= a; ++i)
        ft *= i;

    cout << f(0, 0) / ft << "\n";
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
  
#define pb push_back
#define S second
#define F first
#define f(i,n) for(int i=0;i<n;i++)
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define vi vector<int>
#define pii pair<int,int>
#define all(x) x.begin(),x.end()
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
#define precise(x) fixed << setprecision(x) 

const int MOD = 1e9+7;

int mod_pow(int a,int b,int M = MOD)
{
    if(a == 0) return 0;
    b %= (M - 1);  //M must be prime here
    
    int res = 1;
    
    while(b > 0)
    {
        if(b&1) res=(res*a)%M;
        a=(a*a)%M;
        b>>=1;
    }
    
    return res;
}

const int N = 1e5 + 10;
const int K = 17;

int dp[K][(1<<K)];
int dis[K][(1<<K)];

vi g[N];
int n,m;

void solve()
{
   cin >> n >> m;
    
   int u,v;
   
   f(i,m)
   {
       cin >> u >> v;
       g[u].pb(v);
       g[v].pb(u);
   }
    
   int k;
   cin >> k;
    
   int a[k];
    f(i,k) cin >> a[i];
    
   f(i,k)
   {
       f(j,n+1) dis[i][j] = N;
       
       queue<pii> q;
       q.push({0,a[i]});
       
       while(!q.empty())
       {
           auto x = q.front();
           q.pop();
           
           if(dis[i][x.S] != N) continue;
           dis[i][x.S] = x.F;
           
           for(auto v : g[x.S])
               if(dis[i][v] > x.F + 1)
                 q.push({x.F + 1,v});
       }
   }
    
   f(i,k) f(j,(1<<k)) dp[i][j] = N;
   f(i,k) dp[i][0] = 0;
    
   f(i,(1<<k))
   {
       f(j,k) if(i & (1<<j))
       {
           f(v,k) if(i & (1<<v))
           {
               dp[j][i] = min(dp[j][i] , dp[v][i^(1<<j)] + dis[j][a[v]]);
           }
       }
   }
    
   int res = N;
   f(i,k) res = min(res,dp[i][(1<<k)-1]);
    
   if( res == N) res = -2;
    
   cout << res + 1;
}

signed main()
{
    fast;
    
    int t = 1;
    
//    cin >> t;
    
    while(t--)
        
    solve();
}
