#include <bits/stdc++.h>
using namespace std;
int a[1000000];
int num[1000000];
int main() {
  int n;
  while (cin >> n) {
    long long sum = 0;
    for (int i = 0; i < n; ++i) {
      cin >> a[i];
      if (i > 0) sum += a[i] - a[i - 1];
    }
    vector<int> nima;
    int m;
    cin >> m;
    for (int i = 0; i < m; ++i) {
      int t;
      cin >> t;
      --t;
      num[t]++;
      if (t == 0) num[t]++;
      if (t == n - 1) num[t]++;
    }
    int ok = 1;
    int max_n = 0, min_n = -1;
    for (int i = 0; i < n; ++i) {
      if (num[i] > 0) {
        max_n = max(max_n, num[i]);
        if (min_n == -1 || num[i] < min_n) min_n = num[i];
      } else
        ok = 0;
    }
    if (max_n == min_n && ok == 1) {
      int k = a[1] - a[0];
      for (int i = 1; i < n; ++i) {
        if (a[i] - a[i - 1] != k) ok = 0;
      }
      if (ok) {
        long long ans = 0;
        for (int i = 0; i < n - 1; ++i) {
          ans += (long long)(a[i + 1] - a[i]) * max_n;
        }
        cout << ans - (a[1] - a[0]) << endl;
      } else {
        cout << -1 << endl;
      }
    } else {
      long long ans = 0;
      for (int i = 1; i < n; ++i) {
        ans += (long long)(a[i] - a[i - 1]) * min(num[i - 1], num[i]);
      }
      cout << ans << endl;
    }
  }
}
