#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int MAXN = 100010;
inline int read() {
  char ch = getchar();
  int x = 0, f = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
int n, k, c[MAXN], x;
long long ans, sum;
int main() {
  n = read();
  k = read();
  for (int i = 1; i <= n; i++) {
    c[i] = read();
    sum += c[i];
  }
  for (int i = 0; i < k; i++) {
    x = read();
    sum -= c[x];
    ans += sum * c[x];
    c[x] = 0;
  }
  for (int i = 1; i < n; i++) {
    ans += c[i] * c[i + 1];
  }
  ans += c[n] * c[1];
  cout << ans << endl;
  return 0;
}
