#include <bits/stdc++.h>
using namespace std;
int a[300100];
int b[300100];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  int m;
  scanf("%d", &m);
  if (n == 2) {
    long long res = a[1] - a[0];
    res *= m - 1;
    cout << res << endl;
    return 0;
  }
  while (m--) {
    int x;
    scanf("%d", &x);
    x--;
    b[x]++;
  }
  int u = -1;
  long long res = min(2 * b[0], b[1]);
  res *= a[1] - a[0];
  long long s = min(2 * b[n - 1], b[n - 2]);
  s *= a[n - 1] - a[n - 2];
  res += s;
  if (2 * b[0] != b[1]) u = 0;
  if (2 * b[n - 1] != b[n - 2]) u = n - 1;
  for (int i = 2; i < n - 1; i++) {
    long long s = a[i] - a[i - 1];
    s *= min(b[i], b[i - 1]);
    res += s;
    if (b[i] != b[i - 1]) u = i;
  }
  if (u >= 0) {
    cout << res << endl;
    return 0;
  }
  int z = a[1] - a[0];
  for (int i = 2; i < n; i++)
    if (a[i] - a[i - 1] != z) {
      cout << -1;
      return 0;
    }
  cout << res - z << endl;
  return 0;
}
