#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int c[N];
bool isCapital[N];
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  long long sum = 0, prev = 0, res = 0;
  for (int i = 0; i < n; ++i) {
    scanf("%d", c + i);
    sum += c[i];
    res += prev * c[i];
    prev = c[i];
  }
  res += prev * c[0];
  long long ids = 0;
  for (int i = 0; i < k; ++i) {
    int id;
    scanf("%d", &id);
    --id;
    res += (sum - c[id]) * c[id] -
           !isCapital[(id + 1) % n] * c[(id + 1) % n] * c[id] -
           !isCapital[(id - 1 + n) % n] * c[(id - 1 + n) % n] * c[id] -
           ids * c[id];
    ids += c[id];
    isCapital[id] = true;
  }
  printf("%lld\n", res);
}
