#include <bits/stdc++.h>
using namespace std;
const int N = (int)2e5 + 5;
int n, m, a[N], c[4 * N], cnt[N], cnt2[N];
long long dist[4 * N];
void add(int x, int &cntp, int &cntn) {
  if (cnt[x] == cnt2[x]) ++cntp;
  ++cnt[x];
  if (cnt[x] == cnt2[x]) --cntn;
}
void remove_(int x, int &cntp, int &cntn) {
  if (cnt[x] == cnt2[x]) ++cntn;
  --cnt[x];
  if (cnt[x] == cnt2[x]) --cntp;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  for (int i = 1, cur = 1, mode = 1; i <= 4 * (N - 5); ++i) {
    c[i] = cur, cur += 1 * mode;
    if (cur == n + 1 && mode == 1) mode = -1, cur = n - 1;
    if (cur == 0 && mode == -1) mode = 1, cur = 2;
    if (i > 1) dist[i] = dist[i - 1] + (long long)abs(a[c[i]] - a[c[i - 1]]);
  }
  scanf("%d", &m);
  for (int i = 1, x; i <= m; ++i) scanf("%d", &x), ++cnt2[x];
  int cntn = 0, cntp = 0;
  for (int i = 1; i <= n; ++i)
    if (cnt2[i]) ++cntn;
  for (int i = 1; i <= m; ++i) add(c[i], cntp, cntn);
  long long res = -1;
  for (int i = 1; i <= 4 * (N - 5) - m + 1; ++i) {
    if (!cntn && !cntp) {
      if (res != -1 && dist[i + m - 1] - dist[i] != res) {
        printf("-1");
        return 0;
      }
      res = dist[i + m - 1] - dist[i];
    }
    remove_(c[i], cntp, cntn);
    add(c[i + m], cntp, cntn);
  }
  printf("%lld", res);
  return 0;
}
