#include <bits/stdc++.h>
using namespace std;
int n, m;
long long int d[300000];
int s[300000];
long long int res;
int MINI[800000], MAXI[800000], art[800000], nu[800000];
void init(int root, int bas, int son) {
  art[root] = 0;
  if (bas == son) {
    MINI[root] = s[bas];
    MAXI[root] = s[bas];
    nu[bas] = root;
    return;
  }
  init(root * 2, bas, (bas + son) / 2);
  init(root * 2 + 1, (bas + son) / 2 + 1, son);
  MINI[root] = min(MINI[root * 2], MINI[root * 2 + 1]) + art[root];
  MAXI[root] = max(MAXI[root * 2], MAXI[root * 2 + 1]) + art[root];
}
inline void update(int root, int bas, int son, int x, int y, int val) {
  if (son < x or y < bas) return;
  if (x <= bas and son <= y) {
    MINI[root] += val;
    MAXI[root] += val;
    art[root] += val;
    return;
  }
  update(root * 2, bas, (bas + son) / 2, x, y, val);
  update(root * 2 + 1, (bas + son) / 2 + 1, son, x, y, val);
  MINI[root] = min(MINI[root * 2], MINI[root * 2 + 1]) + art[root];
  MAXI[root] = max(MAXI[root * 2], MAXI[root * 2 + 1]) + art[root];
}
inline int getmin(int root, int bas, int son, int x, int y) {
  if (son < x or y < bas) return 1000000007LL;
  if (x <= bas and son <= y) return MINI[root];
  return min(getmin(root * 2, bas, (bas + son) / 2, x, y),
             getmin(root * 2 + 1, (bas + son) / 2 + 1, son, x, y)) +
         art[root];
}
inline int getmax(int root, int bas, int son, int x, int y) {
  if (son < x or y < bas) return 0;
  if (x <= bas and son <= y) return MAXI[root];
  return max(getmax(root * 2, bas, (bas + son) / 2, x, y),
             getmax(root * 2 + 1, (bas + son) / 2 + 1, son, x, y)) +
         art[root];
}
inline int SAG(int root, int bas, int son, int x, int ek = 0) {
  if (son < x) return 0;
  if (x <= bas and MINI[root] + ek == 1 and MAXI[root] + ek == 1)
    return son - bas + 1;
  if (bas == son) return 0;
  int t = SAG(root * 2, bas, (bas + son) / 2, x, ek + art[root]);
  if (t == max(0, ((bas + son) / 2 - max(bas, x) + 1)))
    return t + SAG(root * 2 + 1, (bas + son) / 2 + 1, son, x, ek + art[root]);
  return t;
}
inline int SOL(int root, int bas, int son, int x, int ek = 0) {
  if (x < bas) return 0;
  if (son <= x and MINI[root] + ek == 1 and MAXI[root] + ek == 1)
    return son - bas + 1;
  if (bas == son) return 0;
  int t = SOL(root * 2 + 1, (bas + son) / 2 + 1, son, x, ek + art[root]);
  if (t == max(0, (min(x, son) - ((bas + son) / 2 + 1) + 1)))
    return t + SOL(root * 2, bas, (bas + son) / 2, x, ek + art[root]);
  return t;
}
int sor(int x) {
  int res = MINI[x];
  while (x != 1) {
    x >>= 1;
    res += art[x];
  }
  return res;
}
int equal(int x, int y, int c) {
  if (x > y) return 1;
  int a, b;
  a = getmin(1, 1, n, x, y);
  b = getmax(1, 1, n, x, y);
  return a == b and a == c;
}
long long int solve1(int x) {
  if (sor(nu[x]) != 1) return 45645641374931LL;
  int i = (x == 1 ? 0 : x - SOL(1, 1, n, x));
  if (!equal(1, i, 0) or !equal(x + 1, n, 0)) return 45645641374931LL;
  return d[x] - d[i + 1];
}
long long int solve2(int x) {
  if (sor(nu[x]) != 1 or sor(nu[1]) != 1) return 45645641374931LL;
  int i = (x == 1 ? 0 : x - SOL(1, 1, n, x));
  if (i == 0) return 45645641374931LL;
  if (!equal(2, i, 2) or !equal(x + 1, n, 0)) return 45645641374931LL;
  return d[x] - d[1] + d[i] - d[1];
}
long long int solve3(int x) {
  if (sor(nu[x]) != 2 or sor(nu[1]) != 1) return 45645641374931LL;
  int i = (x == n ? n + 1 : x + 1 + SAG(1, 1, n, x + 1));
  if (!equal(2, x, 2) or !equal(i, n, 0)) return 45645641374931LL;
  return d[x] - d[1] + d[i - 1] - d[1];
}
long long int solve4(int x) {
  if (sor(nu[x]) != 2 or sor(nu[1]) != 1 or sor(nu[n]) != 1)
    return 45645641374931LL;
  int i = (x == n ? n + 1 : x + 1 + SAG(1, 1, n, x + 1));
  if (i == n + 1) return 45645641374931LL;
  if (!equal(2, x, 2) or !equal(i, n - 1, 2)) return 45645641374931LL;
  return d[x] - d[1] + d[n] - d[1] + d[n] - d[i];
}
int main() {
  cin >> n;
  for (long long int i = 1; i <= n; i++) scanf("%d", d + i);
  cin >> m;
  for (long long int i = 1; i <= m; i++) {
    int x;
    scanf("%d", &x);
    s[x]++;
  }
  set<long long int> S;
  int OK = 0;
go:
  init(1, 1, n);
  for (long long int i = 1; i <= n; i++) {
    long long int a;
    int x = 1000000007LL;
    if (n > 2) x = getmin(1, 1, n, 2, n - 1) / 2;
    x = min(x, getmin(1, 1, n, 1, 1) - (i == 1));
    x = min(x, getmin(1, 1, n, n, n) - (i == n));
    if (i != 1 and i != n) x = min(x, (getmin(1, 1, n, i, i) - 1) / 2);
    x = max(x, 0);
    update(1, 1, n, 1, n, -x);
    if (n > 2) update(1, 1, n, 2, n - 1, -x);
    if (equal(1, i - 1, 0) and equal(i + 1, n, 0) and equal(i, (int)i, 1))
      S.insert(x * abs(d[n] - d[1]) * 2);
    a = solve1(i);
    if (a != 45645641374931LL)
      S.insert((OK ? -1 : 1) * a + x * abs(d[n] - d[1]) * 2);
    a = solve2(i);
    if (a != 45645641374931LL)
      S.insert((OK ? -1 : 1) * a + x * abs(d[n] - d[1]) * 2);
    a = solve3(i);
    if (a != 45645641374931LL)
      S.insert((OK ? -1 : 1) * a + x * abs(d[n] - d[1]) * 2);
    a = solve4(i);
    if (a != 45645641374931LL)
      S.insert((OK ? -1 : 1) * a + x * abs(d[n] - d[1]) * 2);
    update(1, 1, n, 1, n, +x);
    if (n > 2) update(1, 1, n, 2, n - 1, +x);
    if (S.size() > 1) {
      cout << -1 << endl;
      return 0;
    }
  }
  reverse(d + 1, d + n + 1);
  reverse(s + 1, s + n + 1);
  if (!OK) {
    OK = 1;
    goto go;
  }
  if (S.size() - 1 and !equal(1, n, 0))
    cout << -1 << endl;
  else
    cout << (*S.begin()) << endl;
}
