#include <bits/stdc++.h>
int n, m;
long long d[201000];
int a[201000], aa[201000];
long long max(long long a, long long b) {
  if (b >= a) {
    a = b;
  }
  return a;
}
long long dis(int a, int b) {
  long long dd;
  dd = d[a] - d[b];
  if (dd < 0) {
    dd = -dd;
  }
  return dd;
}
long long run(int p, int k) {
  int i;
  long long ans;
  for (i = 1; i <= n; i++) {
    aa[i] = a[i];
  }
  ans = 0;
  if (!aa[p]) {
    return -1;
  }
  aa[p]--;
  for (i = 2; i <= m; i++) {
    ans += dis(p, p + k);
    p += k;
    if (aa[p]) {
      aa[p]--;
      if (p == 1 || p == n) {
        k *= -1;
      }
    } else {
      return -1;
    }
  }
  return ans;
}
int main(void) {
  int i, j;
  long long ansss;
  int mi, ma;
  int gg, gggggg;
  int aaa;
  while (scanf("%d", &n) != EOF) {
    for (i = 1; i <= n; i++) {
      scanf("%I64d", &d[i]);
    }
    gggggg = 0;
    gg = d[2] - d[1];
    for (i = 3; i <= n; i++) {
      if (d[i] - d[i - 1] != gg) {
        gggggg = 1;
        break;
      }
    }
    for (i = 1; i <= n; i++) {
      a[i] = 0;
    }
    scanf("%d", &m);
    for (i = 1; i <= m; i++) {
      scanf("%d", &aaa);
      a[aaa]++;
    }
    ansss = -1;
    ansss = max(ansss, run(1, 1));
    ansss = max(ansss, run(n, -1));
    mi = 1000000000;
    ma = -1000000000;
    for (i = 2; i < n; i++) {
      if (a[i] < mi) {
        mi = a[i];
      }
      if (a[i] > ma) {
        ma = a[i];
      }
    }
    if (ma == mi && gggggg) {
      if (a[2] == a[1] + a[1] && a[2] == a[n] + a[n]) {
        ansss = -1;
      } else {
        if (a[2] == a[1] + a[1]) {
          ansss = max(ansss, run(n - 1, -1));
        } else {
          ansss = max(ansss, run(2, 1));
        }
      }
    } else {
      for (i = 2; i < n; i++) {
        if (a[i] == ma && a[i - 1] != ma) {
          ansss = max(ansss, run(i, 1));
        }
        if (a[i] == ma && a[i + 1] != ma) {
          ansss = max(ansss, run(i, -1));
        }
      }
    }
    printf("%I64d\n", ansss);
  }
  return 0;
}
