#include <bits/stdc++.h>
using namespace std;
int IN() {
  int x = 0, ch;
  for (; (ch = getchar()) < '0' || ch > '9';)
    ;
  for (; ch >= '0' && ch <= '9'; (ch = getchar())) (x *= 10) += ch - '0';
  return x;
}
long long Ans = -1, Dis;
int N, M, A[200005], B[200005], C[200005];
int main() {
  N = IN();
  for (int i = 1; i <= N; i++) A[i] = IN();
  M = IN();
  for (int i = 1; i <= M; i++) C[IN()]++;
  int cnt = 0, now = 1, flag = 1;
  for (int i = 1; i <= N; i++)
    if (!(B[i] = C[i])) cnt++;
  for (int i = 1; i <= M; i++) {
    cnt = cnt - (!B[now]) + (!(--B[now]));
    if (i != M) {
      if (now == N && flag == 1 || now == 1 && flag == -1) flag *= -1;
      int t = now;
      now += flag;
      Dis += abs(A[now] - A[t]);
    }
  }
  for (int i = 1; i <= N; i++) {
    if (cnt == N) {
      if (Ans == -1) Ans = Dis;
      if (Ans != Dis) return puts("-1"), 0;
    }
    if (i != N) {
      cnt = cnt - (!B[i]) + (!(++B[i]));
      Dis -= A[i + 1] - A[i];
      if (now == N && flag == 1 || now == 1 && flag == -1) flag *= -1;
      int t = now;
      now += flag;
      Dis += abs(A[now] - A[t]);
      cnt = cnt - (!B[now]) + (!(--B[now]));
    }
  }
  cnt = 0, now = N, flag = -1;
  Dis = 0;
  for (int i = 1; i <= N; i++)
    if (!(B[i] = C[i])) cnt++;
  for (int i = 1; i <= M; i++) {
    cnt = cnt - (!B[now]) + (!(--B[now]));
    if (i != M) {
      if (now == N && flag == 1 || now == 1 && flag == -1) flag *= -1;
      int t = now;
      now += flag;
      Dis += abs(A[now] - A[t]);
    }
  }
  for (int i = N; i >= 1; i--) {
    if (cnt == N) {
      if (Ans == -1) Ans = Dis;
      if (Ans != Dis) return puts("-1"), 0;
    }
    if (i != 1) {
      cnt = cnt - (!B[i]) + (!(++B[i]));
      Dis -= A[i] - A[i - 1];
      if (now == N && flag == 1 || now == 1 && flag == -1) flag *= -1;
      int t = now;
      now += flag;
      Dis += abs(A[now] - A[t]);
      cnt = cnt - (!B[now]) + (!(--B[now]));
    }
  }
  printf("%I64d\n", Ans);
}
