#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
long long c[N], d[N];
int main() {
  long long sum = 0, ans = 0;
  int n, k;
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &c[i]);
    sum += c[i];
  }
  for (int i = 1; i <= k; i++) {
    scanf("%lld", &d[i]);
    sum -= c[d[i]];
    ans += sum * c[d[i]];
    c[d[i]] = 0;
  }
  for (int i = 2; i <= n; i++) {
    ans += c[i] * c[i - 1];
  }
  ans += c[1] * c[n];
  printf("%lld\n", ans);
  return 0;
}
