#include <bits/stdc++.h>
using namespace std;
long long a[100005], c[100005], tree[300005];
long long qleft, qright, qans, pos;
void Build(long long x, long long y, long long node) {
  long long mid;
  if (x == y) {
    tree[node] = a[x];
    return;
  }
  mid = (x + y) / 2;
  Build(x, mid, node * 2);
  Build(mid + 1, y, node * 2 + 1);
  tree[node] = tree[node * 2] + tree[node * 2 + 1];
}
void Sum(long long x, long long y, long long node) {
  long long mid;
  if (x > qright || y < qleft) return;
  if (x >= qleft && y <= qright) {
    qans = qans + tree[node];
    return;
  }
  mid = (x + y) / 2;
  Sum(x, mid, node * 2);
  Sum(mid + 1, y, node * 2 + 1);
}
void Update(long long x, long long y, long long node) {
  long long mid;
  if (x == y) {
    tree[node] = 0;
    return;
  }
  mid = (x + y) / 2;
  if (pos <= mid)
    Update(x, mid, node * 2);
  else
    Update(mid + 1, y, node * 2 + 1);
  tree[node] = tree[node * 2] + tree[node * 2 + 1];
}
int main() {
  long long n, k, i, ans = 0;
  scanf("%I64d%I64d", &n, &k);
  for (i = 1; i <= n; i++) scanf("%I64d", &a[i]);
  for (i = 1; i <= k; i++) scanf("%I64d", &c[i]);
  Build(1, n, 1);
  ans = ans + a[n] * a[1];
  for (i = 1; i < n; i++) ans = ans + a[i] * a[i + 1];
  for (i = 1; i <= k; i++) {
    if (c[i] >= 3) {
      qans = 0;
      qleft = 1;
      qright = c[i] - 2;
      if (c[i] == n) qleft = 2;
      if (qleft <= qright) {
        Sum(1, n, 1);
        ans = ans + a[c[i]] * qans;
      }
    }
    if (c[i] <= n - 2) {
      qans = 0;
      qleft = c[i] + 2;
      qright = n;
      if (c[i] == 1) qright = n - 1;
      if (qleft <= qright) {
        Sum(1, n, 1);
        ans = ans + a[c[i]] * qans;
      }
    }
    pos = c[i];
    Update(1, n, 1);
  }
  printf("%I64d\n", ans);
  return 0;
}
