#include <bits/stdc++.h>
using namespace std;
long long d[200005];
int cnt[200005];
int main() {
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> d[i];
  cin >> m;
  for (int i = 1; i <= m; ++i) {
    int t;
    cin >> t;
    ++cnt[t];
  }
  cnt[1] <<= 1;
  cnt[n] <<= 1;
  bool flag = false;
  for (int i = 2; i <= n; ++i) {
    if (cnt[i] != cnt[i - 1]) {
      flag = true;
      break;
    }
  }
  long long ans = 0;
  if (flag) {
    for (int i = 2; i <= n; ++i) {
      ans += min(cnt[i - 1], cnt[i]) * (d[i] - d[i - 1]);
    }
  } else {
    for (int i = 2; i < n; ++i)
      if (d[i] - d[i - 1] != d[i + 1] - d[i]) {
        flag = true;
        break;
      }
    if (flag)
      ans = -1;
    else
      ans = cnt[1] * (d[n] - d[1]) - d[2] + d[1];
  }
  cout << ans << endl;
  return 0;
}
