#include <bits/stdc++.h>
using namespace std;
const int NN = 200200;
int a[NN], d[NN];
bool ok(int n) {
  int d = a[2] - a[1];
  for (int i = 3; i <= n; i++)
    if (a[i] - a[i - 1] != d) return 1;
  return 0;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  long long ans = 0;
  int m;
  scanf("%d", &m);
  for (int i = 1; i <= m; i++) {
    int u;
    scanf("%d", &u);
    d[u]++;
  }
  if (m == 1) {
    puts("0");
    return 0;
  }
  if (!d[1] and !d[n]) {
    int id = 2;
    for (; id < n; id++)
      if (d[id]) break;
    int z = 1;
    int N = 1;
    long long ans = 0;
    for (int i = id + 1; i < n; i++) {
      z = min(z, d[i]);
      ans += 1LL * z * (a[i] - a[i - 1]);
      N += z;
    }
    if (N != m) {
      puts("-1");
      return 0;
    }
    cout << ans << endl;
    return 0;
  }
  int N = 0;
  if (d[1] >= 2) {
    int f = d[1] - 1;
    d[1] = 1;
    for (int i = 2; i < n; i++) {
      if (d[i] < 2 * f) {
        puts("-1");
        return 0;
      }
      d[i] -= 2 * f;
    }
    if (d[n] < f) {
      puts("-1");
      return 0;
    }
    d[n] -= f;
    ans += 2LL * f * (a[n] - a[1]);
    N += f * (2 * n - 2);
  }
  if (d[n] >= 2) {
    int f = d[n] - 1;
    d[n] = 1;
    for (int i = 2; i < n; i++) {
      if (d[i] < 2 * f) {
        puts("-1");
        return 0;
      }
      d[i] -= 2 * f;
    }
    if (d[1] < f) {
      puts("-1");
      return 0;
    }
    d[1] -= f;
    ans += 2LL * f * (a[n] - a[1]);
    N += f * (2 * n - 2);
  }
  int fl = 0;
  if (d[1] and d[n]) {
    for (int i = 1; i <= n; i++) {
      if (!d[i]) {
        puts("-1");
        return 0;
      }
      d[i]--;
    }
    N += n;
    ans += a[n] - a[1];
    int nn = 0, G = 0;
    for (int i = 2; i < n; i++) {
      if (d[i] > 1) G = 1;
      if (d[i] > 2) {
        puts("-1");
        return 0;
      }
      if (d[i]) nn++;
    }
    if (!nn) {
      if (N != m) {
        puts("-1");
        return 0;
      }
      cout << ans << endl;
      return 0;
    }
    if (G and nn != n - 2) {
      puts("-1");
      return 0;
    }
    if (!G and nn == n - 2) {
      if (ok(n)) {
        puts("-1");
        return 0;
      }
      ans += a[n] - a[2];
      cout << ans << endl;
      return 0;
    }
    int id = 2;
    while (d[id] >= d[id - 1] and id < n and d[id])
      N++, ans += a[id] - a[id - 1], id++;
    id--;
    while (id > 1) d[id]--, id--;
    id = n - 1;
    while (d[id] >= d[id + 1] and id > 1 and d[id])
      N++, ans += a[id + 1] - a[id], id--;
    if (N != m) {
      puts("-1");
      return 0;
    }
    cout << ans << endl;
    return 0;
  }
  if (d[1]) {
    int id = 2;
    N++;
    for (int i = 2; i < n; i++) {
      id = min(id, d[i]);
      ans += 1LL * id * (a[i] - a[i - 1]);
      N += id;
    }
    if (N != m) {
      puts("-1");
      return 0;
    }
    cout << ans << endl;
    return 0;
  }
  int id = 2;
  N++;
  for (int i = n - 1; i > 1; i--) {
    id = min(id, d[i]);
    ans += 1LL * id * (a[i + 1] - a[i]);
    N += id;
  }
  if (N != m) {
    puts("-1");
    return 0;
  }
  cout << ans << endl;
  return 0;
}
