#include <bits/stdc++.h>
using namespace std;
int d[200010], vaz[200010];
long long sum[1000010];
int main() {
  int n, m, x;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &d[i]);
  for (int i = 1; i < n; i++) sum[i] = sum[i - 1] + d[i + 1] - d[i];
  for (int i = n; i > 1; i--)
    sum[n + n - i] = sum[n + n - i - 1] + d[i] - d[i - 1];
  for (int i = 2 * n - 1; i < n * 4 - 3; i++)
    sum[i] = sum[2 * n - 2] + sum[i - (2 * n - 2)];
  scanf("%d", &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d", &x);
    vaz[x]++;
  }
  int minn = min(vaz[1], vaz[n]), k = 0;
  for (int i = 2; i < n; i++) minn = min(minn, vaz[i] / 2);
  vaz[1] -= minn;
  vaz[n] -= minn;
  for (int i = 2; i < n; i++) vaz[i] -= minn * 2;
  for (int i = 1; i <= n; i++)
    if (vaz[i]) {
      k = 1;
      break;
    }
  if (!k) {
    for (int i = 1; i <= 2 * n - 2; i++)
      if (sum[i + 2 * n - 3 - 1] - sum[i - 1] != sum[2 * n - 2 - 1]) {
        k = 1;
        break;
      }
    if (minn > 1)
      for (int i = 1; i <= 2 * n - 2; i++)
        if (sum[i + 2 * n - 3] - sum[i - 1] != sum[2 * n - 2]) {
          k = 1;
          break;
        }
    if (!k)
      printf("%I64d", sum[2 * n - 2 - 1] + sum[2 * n - 2] * (minn - 1));
    else
      printf("-1");
  } else if (vaz[1] && vaz[n]) {
    int a, b;
    for (int i = 2; i < n; i++) vaz[i]--;
    for (a = 1; vaz[a]; a++) vaz[a]--;
    for (b = n; vaz[b]; b--) vaz[b]--;
    printf("%I64d", (sum[2 * n - 2 + b] - sum[b]) * minn +
                        sum[2 * n - 3 + a - 1] - sum[b]);
  } else if (vaz[1]) {
    int a, b;
    for (a = 1; vaz[a]; a++) vaz[a]--;
    for (b = 2; vaz[b]; b++) vaz[b]--;
    printf("%I64d", (sum[4 * n - 2 - b] - sum[2 * n - b]) * minn +
                        sum[2 * n - 3 + a - 1] - sum[2 * n - b]);
  } else if (vaz[n]) {
    int a, b;
    for (a = n; vaz[a]; a--) vaz[a]--;
    for (b = n - 1; vaz[b]; b--) vaz[b]--;
    printf("%I64d", (sum[2 * n - 2 + b] - sum[b]) * minn +
                        sum[2 * n - a - 1 - 1] - sum[b]);
  } else {
    int a, b;
    for (a = 1; !vaz[a]; a++)
      ;
    for (b = a; vaz[b]; b++)
      ;
    printf("%I64d", (sum[2 * n - 2 + a - 1] - sum[a - 1]) * minn +
                        sum[b - 1 - 1] - sum[a - 1]);
  }
  return 0;
}
