#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  long long r;
  while (b != 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
const int maxn = 200010;
int n, m;
int a[maxn];
int cnt[maxn];
void solve() {
  memset(cnt, 0, sizeof(cnt));
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  scanf("%d", &m);
  for (int i = 0; i < m; i++) {
    int b;
    scanf("%d", &b);
    cnt[b - 1]++;
  }
  bool flag1 = m % ((n - 1) << 1);
  long long ans = 0;
  cnt[0] <<= 1;
  cnt[n - 1] <<= 1;
  bool flag2 = 1;
  for (int i = 0; i < n - 1; i++) {
    ans += 1LL * min(cnt[i], cnt[i + 1]) * (a[i + 1] - a[i]);
    flag2 &= a[i + 1] - a[i] == a[1] - a[0];
  }
  if (flag1 || flag2)
    printf("%I64d", ans - (!flag1) * (a[1] - a[0]));
  else
    printf("-1");
}
int main() {
  solve();
  return 0;
}
