#include <bits/stdc++.h>
int z[200007];
int main() {
  int n;
  scanf("%d", &n);
  int a[200007];
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  int m;
  scanf("%d", &m);
  for (int i = 1, j; i <= m; i++) {
    scanf("%d", &j);
    z[j]++;
  }
  long long L;
  int t = m / ((n - 1) * 2);
  L = (long long)t * (a[n] - a[1]) * 2;
  z[1] *= 2;
  z[n] *= 2;
  for (int i = 1; i <= n; i++) z[i] -= 2 * t;
  if (z[1] && z[n]) {
    int zz, xx, i;
    for (zz = 1; zz < n; zz++)
      if (z[zz] == 1) break;
    for (xx = n; xx > 1; xx--)
      if (z[xx] == 1) break;
    L += a[zz - 1] - a[1];
    L += a[n] - a[xx + 1];
    L += a[n] - a[1];
  } else if (z[1]) {
    int zz, xx, i;
    for (zz = 1; zz < n; zz++)
      if (z[zz] <= 1) break;
    for (xx = zz; xx < n; xx++)
      if (z[xx] == 0) break;
    L += a[zz - 1] - a[1];
    L += a[xx - 1] - a[1];
  } else if (z[n]) {
    int zz, xx, i, _ = n + 1;
    for (zz = 1; zz < n; zz++)
      if (z[_ - zz] <= 1) break;
    for (xx = zz; xx < n; xx++)
      if (z[_ - xx] == 0) break;
    L -= a[_ - (zz - 1)] - a[n];
    L -= a[_ - (xx - 1)] - a[n];
  } else {
    int zz, xx, i;
    for (zz = 1; zz < n; zz++)
      if (z[zz] == 1) break;
    if (zz == n) goto pu;
    for (xx = zz; xx < n; xx++)
      if (z[xx] == 0) break;
    L += a[xx - 1] - a[zz];
  }
  printf("%I64d\n", L);
  ;
  return 0;
pu:
  int c = a[2] - a[1];
  for (int i = 2; i < n; i++)
    if (a[i + 1] - a[i] != c) {
      printf("%d\n", -1);
      ;
      return 0;
    }
  printf("%I64d\n", L - c);
  ;
  return 0;
}
