#include <bits/stdc++.h>
using namespace std;
int dis[200010];
int n, m;
int cnt[200010];
long long path(int s, int delta) {
  long long length = 0;
  int cur = s;
  for (int i = 1; i < m; ++i) {
    if (cur == 1)
      delta = 1;
    else if (cur == n)
      delta = -1;
    length += abs(dis[cur] - dis[cur + delta]);
    cur = cur + delta;
  }
  return length;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> dis[i];
  }
  memset(cnt, 0, sizeof(cnt));
  cin >> m;
  int Max = 1;
  for (int i = 0; i < m; ++i) {
    int tmp;
    cin >> tmp;
    ++cnt[tmp];
  }
  cnt[1] *= 2;
  cnt[n] *= 2;
  for (int i = 1; i <= n; ++i) {
    if (cnt[i] > Max) Max = cnt[i];
  }
  long long res = -1;
  for (int i = 1; i <= n; ++i) {
    if (cnt[i] == Max) {
      if (i > 1 && cnt[i] > cnt[i - 1]) {
        long long l = path(i, 1);
        if (res > 0 && res != l) {
          cout << -1 << endl;
          return 0;
        } else
          res = l;
      }
      if (i < n && cnt[i] > cnt[i + 1]) {
        long long l = path(i, -1);
        if (res > 0 && res != l) {
          cout << -1 << endl;
          return 0;
        } else
          res = l;
      }
    }
  }
  if (res == -1) {
    for (int i = 3; i <= n; ++i) {
      if (dis[i] - dis[i - 1] != dis[i - 1] - dis[i - 2]) {
        cout << -1 << endl;
        return 0;
      }
    }
    res = path(1, 1);
  }
  cout << res << endl;
  return 0;
}
