#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 200000;
int as[MAX_N], cs[MAX_N];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", as + i);
  int m;
  scanf("%d", &m);
  for (int i = 0; i < m; i++) {
    int bi;
    scanf("%d", &bi);
    bi--;
    cs[bi]++;
  }
  cs[0] *= 2, cs[n - 1] *= 2;
  int minc = cs[0], maxc = cs[0];
  for (int i = 1; i < n; i++) {
    if (minc > cs[i]) minc = cs[i];
    if (maxc < cs[i]) maxc = cs[i];
  }
  long long sum = (long long)minc * (as[n - 1] - as[0]);
  for (int i = 0; i < n; i++) cs[i] -= minc;
  if (minc == maxc) {
    int d = as[1] - as[0];
    for (int i = 2; d > 0 && i < n; i++)
      if (d != as[i] - as[i - 1]) {
        puts("-1");
        return 0;
      }
    sum -= d;
  } else {
    while (cs[0] > 0) {
      int k = 0;
      for (; k < n && cs[k] > 0; k++) cs[k]--;
      sum += as[k - 1] - as[0];
    }
    while (cs[n - 1] > 0) {
      int k = n - 1;
      for (; k >= 0 && cs[k] > 0; k--) cs[k]--;
      sum += as[n - 1] - as[k + 1];
    }
    for (int i = 0, pc = 0; i < n; i++)
      if (cs[i] > 0) {
        if (pc > 0) sum += as[i] - as[i - 1];
        pc = 1;
      }
  }
  printf("%lld\n", sum);
  return 0;
}
