#include <bits/stdc++.h>
using namespace std;
long long cost[100001] = {0};
vector<int> capitals;
bool isCapital[100001] = {false};
int main() {
  long long n, k;
  long long ans = 0;
  long long sum = 0;
  cin >> n >> k;
  int prev = -1;
  for (int i = 0; i <= n - 1; i++) {
    scanf("%d", &cost[i]);
    if (i == 0)
      prev = cost[i];
    else {
      ans += prev * cost[i];
      prev = cost[i];
    }
    sum += cost[i];
  }
  long long tmp = sum;
  ans += prev * cost[0];
  int t;
  for (int i = 0; i <= k - 1; i++) {
    scanf("%d", &t);
    t--;
    isCapital[t] = true;
    ans += cost[t] * (sum - cost[t] -
                      (t - 1 < 0 ? (!isCapital[n - 1] ? cost[n - 1] : 0)
                                 : (!isCapital[t - 1] ? cost[t - 1] : 0)) -
                      (t + 1 == n ? (!isCapital[0] ? cost[0] : 0)
                                  : (!isCapital[t + 1] ? cost[t + 1] : 0)));
    sum -= cost[t];
  }
  cout << ans << endl;
  return 0;
}
