#include <bits/stdc++.h>
using namespace std;
long long c[100001], out(0), sum(0);
int main() {
  int n, k, x;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> c[i];
    sum += c[i];
  }
  while (k-- > 0) {
    cin >> x;
    sum -= c[x];
    out += sum * c[x];
    c[x] = 0;
  }
  c[n + 1] = c[1];
  for (int i = 1; i <= n; i++) out += c[i] * c[i + 1];
  cout << out;
}
