#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const double EPS = 1e-6;
int cnt[200005];
int dist[200005];
int tmp[200005];
int n, m;
long long Run(int start, bool isRight) {
  memmove(tmp, cnt, sizeof(tmp));
  int now = start;
  long long res = 0LL;
  for (int k = 0; k < m; k++) {
    if (tmp[now] > 0)
      tmp[now]--;
    else
      return -1;
    if (k == m - 1) return res;
    if (now == n) isRight = false;
    if (now == 1) isRight = true;
    if (isRight) {
      now++;
      res += dist[now];
    } else {
      res += dist[now];
      now--;
    }
  }
  return res;
}
bool Check(long long newRes, long long &res) {
  if (res == -1) {
    res = newRes;
    return true;
  }
  if (newRes != -1 && newRes != res) return false;
  return true;
}
long long Solve() {
  long long res = -1;
  if (!Check(Run(1, true), res)) return -1;
  if (!Check(Run(2, false), res)) return -1;
  if (!Check(Run(n, false), res)) return -1;
  if (!Check(Run(n - 1, true), res)) return -1;
  for (int i = 2; i <= n - 1; i++) {
    if (cnt[i] > cnt[i - 1])
      if (!Check(Run(i, true), res)) return -1;
    if (cnt[i] > cnt[i + 1])
      if (!Check(Run(i, false), res)) return -1;
  }
  return res;
}
int main() {
  { ; };
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", dist + i);
  scanf("%d", &m);
  for (int j = 0; j < m; j++) {
    int b;
    scanf("%d", &b);
    cnt[b]++;
  }
  for (int i = n; i >= 1; i--) dist[i] -= dist[i - 1];
  dist[1] = 0;
  cout << Solve() << endl;
  return 0;
}
