#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
long long a[N], cnt[N];
int n, m;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%I64d", &a[i]);
  scanf("%d", &m);
  for (int i = 1; i <= m; i++) {
    int x;
    scanf("%d", &x);
    cnt[x]++;
  }
  cnt[1] *= 2;
  cnt[n] *= 2;
  long long mx = cnt[1], mi = cnt[1];
  for (int i = 2; i <= n; i++) mx = max(mx, cnt[i]), mi = min(mi, cnt[i]);
  if (mx == mi) {
    for (int i = 2; i < n; i++)
      if (a[i] - a[i - 1] != a[i + 1] - a[i]) {
        printf("-1\n");
        return 0;
      }
    long long sum = 0;
    for (int i = 2; i <= n; i++) sum += a[i] - a[i - 1];
    printf("%I64d\n", sum * mx - a[2] + a[1]);
  } else {
    long long ans = 0;
    for (int i = 2; i <= n; i++)
      ans += min(cnt[i], cnt[i - 1]) * (a[i] - a[i - 1]);
    printf("%I64d\n", ans);
  }
}
