#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const int INF = 0x3f3f3f3f;
long long n, m, a[200005], b[2 * 200005], hsh[200005];
int main() {
  long long i, j, k, minn, maxn, ans;
  bool flag;
  memset(hsh, 0, sizeof(hsh));
  scanf("%I64d", &n);
  for (i = 1; i <= n; i++) scanf("%I64d", &a[i]);
  scanf("%I64d", &m);
  minn = INF, maxn = 0;
  for (i = 1; i <= m; i++) {
    scanf("%I64d", &b[i]);
    hsh[b[i]]++;
    if (b[i] == 1 || b[i] == n) hsh[b[i]]++;
  }
  for (i = 1; i <= n; i++) {
    minn = min(minn, hsh[i]);
    maxn = max(maxn, hsh[i]);
  }
  if (minn == maxn) {
    flag = true;
    for (i = 1; i <= n - 2; i++) {
      if (a[i + 1] - a[i] != a[i + 2] - a[i + 1]) {
        flag = false;
        break;
      }
    }
    if (!flag)
      printf("-1\n");
    else
      printf("%I64d\n", (a[n] - a[1]) * minn - (a[2] - a[1]));
  } else {
    long long ans = 0;
    for (i = 1; i <= n - 1; i++) {
      ans += (a[i + 1] - a[i]) * min(hsh[i + 1], hsh[i]);
    }
    printf("%I64d\n", ans);
  }
  return 0;
}
