#include <bits/stdc++.h>
using namespace std;
ifstream fin("A.in");
ofstream fout("A.out");
long long sol;
int a[200100], b[2 * 200100], v[200100];
long long prelen[200100];
bool uniform1[200100], uniform2[200100], semiuniform1[200100],
    semiuniform2[200100];
int semipos1[200100], semipos2[200100];
void update(long long ans) {
  if (sol == -2)
    sol = ans;
  else if (sol != ans)
    sol = -1;
}
long long length(int i, int j) { return a[j] - a[i]; }
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  int m;
  cin >> m;
  for (int i = 1; i <= m; ++i) {
    cin >> b[i];
    v[b[i]]++;
    if (b[i] == 1 || b[i] == n) {
      v[b[i]]++;
    }
  }
  bool oku = 1;
  bool oks = 0;
  int poss = 0;
  uniform1[1] = 1;
  for (int i = 2; i <= n; ++i) {
    if (v[i] != v[i - 1]) {
      if (oku) {
        oku = 0;
        oks = 1;
        poss = i;
      } else
        oks = 0;
    }
    if (oku) {
      uniform1[i] = 1;
    } else if (oks) {
      semiuniform1[i] = 1;
      semipos1[i] = poss;
    }
  }
  oku = 1;
  oks = 0;
  poss = 0;
  uniform2[n] = 1;
  for (int i = n - 1; i >= 1; --i) {
    if (v[i] != v[i + 1]) {
      if (oku) {
        oku = 0;
        oks = 1;
        poss = i;
      } else
        oks = 0;
    }
    if (oku) {
      uniform2[i] = 1;
    } else if (oks) {
      semiuniform2[i] = 1;
      semipos2[i] = poss;
    }
  }
  sol = -2;
  for (int i = 1; i <= n; ++i) {
    if (v[i] == 0) continue;
    if (i == 1 || i == n) v[i]--;
    long long ans = 0;
    if (v[i] & 1) {
      ans = 0;
      if (i != 1) {
        if (uniform2[i + 1] && v[i + 1] == v[i] - 1 || i == n) {
          ans += v[i + 1] * length(i, n);
          if (uniform1[i - 1]) {
            if (v[i - 1] == v[i] - 1 || v[i - 1] == v[i]) {
              ans += length(1, i) * v[i - 1];
              update(ans);
            } else if (v[i - 1] == v[i] + 1) {
              ans += length(1, i) * v[i - 1] - length(i - 1, i);
              update(ans);
            }
          } else if (semiuniform1[i - 1]) {
            int p = semipos1[i - 1];
            if (v[p] == v[i]) {
              if (v[p - 1] == v[p] + 1) {
                ans += length(1, p - 1) * v[p - 1] + length(p - 1, i) * v[p];
                update(ans);
              } else if (v[p - 1] == v[p] - 1) {
                ans += length(1, p) * v[p - 1] + length(p, i) * v[p];
                update(ans);
              }
            }
          }
        }
      }
      ans = 0;
      if (i != n) {
        if (uniform1[i - 1] && v[i - 1] == v[i] - 1 || i == 1) {
          ans += v[i - 1] * length(1, i);
          if (uniform2[i + 1]) {
            if (v[i + 1] == v[i] - 1 || v[i + 1] == v[i]) {
              ans += length(i, n) * v[i + 1];
              update(ans);
            } else if (v[i + 1] == v[i] + 1) {
              ans += length(i, n) * v[i + 1] - length(i, i + 1);
              update(ans);
            }
          } else if (semiuniform2[i + 1]) {
            int p = semipos2[i + 1];
            if (v[p] == v[i]) {
              if (v[p + 1] == v[p] + 1) {
                ans += length(i, p + 1) * v[p] + length(p + 1, n) * v[p + 1];
                update(ans);
              } else if (v[p + 1] == v[p] - 1) {
                ans += length(i, p) * v[p] + length(p, n) * v[p + 1];
                update(ans);
              }
            }
          }
        }
      }
    } else {
      ans = 0;
      if (uniform1[i - 1] == 1 && v[i - 1] == v[i]) {
        ans += length(1, i) * v[i];
        if (uniform2[i + 1]) {
          if (v[i + 1] == v[i] - 2 || v[i + 1] == v[i] - 1) {
            ans += length(i, n) * v[i + 1];
            update(ans);
          } else if (v[i + 1] == v[i]) {
            ans += length(i, n) * v[i + 1] - length(i, i + 1);
            update(ans);
          }
        } else if (semiuniform2[i + 1]) {
          int p = semipos2[i + 1];
          if (v[p] == v[i] - 1) {
            if (v[p] == v[p + 1] + 1) {
              ans += length(i, p) * v[p] + length(p, n) * v[p + 1];
              update(ans);
            } else if (v[p] == v[p + 1] - 1) {
              ans += length(i, p + 1) * v[p] + length(p + 1, n) * v[p + 1];
              update(ans);
            }
          }
        }
      }
      ans = 0;
      if (uniform2[i + 1] == 1 && v[i + 1] == v[i]) {
        ans += length(i, n) * v[i];
        if (uniform1[i - 1]) {
          if (v[i - 1] == v[i] - 2 || v[i - 1] == v[i] - 1) {
            ans += length(1, i) * v[i - 1];
            update(ans);
          } else if (v[i - 1] == v[i]) {
            ans += length(1, i) * v[i - 1] - length(i - 1, i);
            update(ans);
          }
        } else if (semiuniform1[i - 1]) {
          int p = semipos1[i - 1];
          if (v[p] == v[i] - 1) {
            if (v[p] == v[p - 1] - 1) {
              ans += length(1, p - 1) * v[p - 1] + length(p - 1, i) * v[p];
              update(ans);
            } else if (v[p] == v[p - 1] + 1) {
              ans += length(1, p) * v[p - 1] + length(p, i) * v[p];
              update(ans);
            }
          }
        }
      }
    }
    if (i == 1 || i == n) v[i]++;
  }
  cout << sol;
}
