#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void checkMin(T &a, T b) {
  if (b < a) a = b;
}
template <typename T>
inline void checkMax(T &a, T b) {
  if (a < b) a = b;
}
int n, a[200100], m, b[200100];
long long work() {
  int x = b[0];
  for (int i = 0; i < int(n); ++i) {
    checkMin(x, b[i] / (i == 0 || i == n - 1 ? 1 : 2));
  }
  for (int i = 0; i < int(n); ++i) {
    b[i] -= (i == 0 || i == n - 1 ? 1 : 2) * x;
  }
  long long ans = x * 2LL * (a[n - 1] - a[0]);
  if (find_if(b, b + n, [](int o) { return o != 0; }) == b + n) {
    for (int i = 2; i < n; ++i) {
      if (a[i] - a[i - 1] != a[i - 1] - a[i - 2]) {
        return -1;
      }
    }
    ans -= a[1] - a[0];
  }
  vector<int> u;
  for (int i = n - 1; i > 0 && b[i]; --i) {
    u.push_back(i);
    --b[i];
  }
  if (!u.empty()) {
    reverse((u).begin(), (u).end());
    for (int i = n - 2; i >= 0 && b[i]; --i) {
      u.push_back(i);
      --b[i];
    }
    reverse((u).begin(), (u).end());
    for (int i = 0; i < n - 1 && b[i]; ++i) {
      u.push_back(i);
      --b[i];
    }
  } else {
    for (int i = 1; i < n && b[i]; ++i) {
      u.push_back(i);
      --b[i];
    }
    reverse((u).begin(), (u).end());
    for (int i = 0; i < n && b[i]; ++i) {
      u.push_back(i);
      --b[i];
    }
  }
  if (u.empty()) {
    for (int i = 0; i < n; ++i) {
      if (b[i]) {
        u.push_back(i);
      }
    }
  }
  for (int i = 0; i < int(int((u).size()) - 1); ++i) {
    ans += abs(a[u[i + 1]] - a[u[i]]);
  }
  return ans;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < int(n); ++i) {
    scanf("%d", &a[i]);
  }
  scanf("%d", &m);
  for (int i = 0; i < int(m); ++i) {
    int x;
    scanf("%d", &x);
    ++b[x - 1];
  }
  cout << work() << "\n";
  return 0;
}
