#include <bits/stdc++.h>
using namespace std;
template <typename T>
void print_range(const T* begin, const T* end) {}
template <typename T>
inline int sign(const T& a) {
  return a < 0 ? -1 : a > 0;
}
void task();
int main() {
  ios_base::sync_with_stdio(false);
  task();
  return 0;
}
long long a[2 * 100000 + 50];
void task() {
  long long dist = 0;
  int n;
  cin >> n;
  vector<int> used(n + 1, 0), cnt(n + 1, 0);
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  int m;
  cin >> m;
  for (int i = 0; i < m; i++) {
    int v;
    cin >> v;
    used[v]++;
  }
  bool flip = 0;
  int end = 1;
  int prev = 1;
  int ok_cnt = 0;
  vector<bool> ok(n + 1, false);
  for (int i = 0; i < m; i++) {
    dist += abs(a[end] - a[prev]);
    cnt[end]++;
    if (!flip && end == n) {
      flip = 1;
    } else if (flip && end == 1)
      flip = 0;
    prev = end;
    if (flip)
      end--;
    else
      end++;
  }
  for (int i = 1; i <= n; i++)
    if (cnt[i] == used[i]) ok[i] = true, ok_cnt++;
  long long ans = -1;
  if (ok_cnt == n) {
    ans = dist;
  }
  for (int i = 2; i < n; i++) {
    dist -= abs(a[i] - a[i - 1]);
    cnt[i - 1]--;
    if (ok[i - 1]) {
      ok[i - 1] = false;
      ok_cnt--;
    }
    if (cnt[i - 1] == used[i - 1]) {
      ok_cnt++;
      ok[i - 1] = true;
    }
    if (!flip && end == n) {
      flip = 1;
    } else if (flip && end == 1)
      flip = 0;
    dist += abs(a[end] - a[prev]);
    prev = end;
    if (flip)
      end--;
    else
      end++;
    cnt[prev]++;
    if (ok[prev]) {
      ok_cnt--;
      ok[prev] = false;
    }
    if (cnt[prev] == used[prev]) {
      ok_cnt++;
      ok[prev] = true;
    }
    if (ok_cnt == n) {
      if (ans != -1 && ans != dist) {
        cout << -1;
        return;
      } else
        ans = dist;
    }
  }
  dist = 0;
  end = n;
  flip = 1;
  prev = n;
  ok_cnt = 0;
  fill(cnt.begin(), cnt.end(), 0);
  fill(ok.begin(), ok.end(), false);
  for (int i = 0; i < m; i++) {
    dist += abs(a[end] - a[prev]);
    cnt[end]++;
    if (!flip && end == n) {
      flip = 1;
    } else if (flip && end == 1)
      flip = 0;
    prev = end;
    if (flip)
      end--;
    else
      end++;
  }
  for (int i = 1; i <= n; i++)
    if (cnt[i] == used[i]) ok[i] = true, ok_cnt++;
  if (ok_cnt == n) {
    if (ans != -1 && ans != dist) {
      cout << -1;
      return;
    } else
      ans = dist;
  }
  for (int i = n - 1; i > 1; i--) {
    dist -= abs(a[i] - a[i + 1]);
    cnt[i + 1]--;
    if (ok[i + 1]) {
      ok[i + 1] = false;
      ok_cnt--;
    }
    if (cnt[i + 1] == used[i + 1]) {
      ok_cnt++;
      ok[i + 1] = true;
    }
    if (!flip && end == n) {
      flip = 1;
    } else if (flip && end == 1)
      flip = 0;
    dist += abs(a[end] - a[prev]);
    cnt[end]++;
    if (ok[end]) {
      ok_cnt--;
      ok[end] = false;
    }
    if (cnt[end] == used[end]) {
      ok_cnt++;
      ok[end] = true;
    }
    prev = end;
    if (flip)
      end--;
    else
      end++;
    if (ok_cnt == n) {
      if (ans != -1 && ans != dist) {
        cout << -1;
        return;
      } else
        ans = dist;
    }
  }
  cout << ans;
}
