#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int main() {
  fast();
  int n, k, x;
  long long c = 0, cur = 0, ans = 0;
  map<int, long long> be, cap;
  vector<int> cav;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> x;
    be[i + 1] = x;
    c += x;
  }
  for (int i = 0; i < k; i++) {
    cin >> x;
    cap[x]++;
    cav.push_back(x);
    ans += (be[x] * (c - be[x]));
    c -= be[x];
  }
  for (int i = 1; i < n; i++) {
    if (!(cap[i] || cap[(i + 1)])) ans += (be[i] * be[(i + 1)]);
  }
  if (!(cap[n] || cap[(1)])) ans += (be[n] * be[1]);
  cout << ans;
  return 0;
}
