#include <bits/stdc++.h>
using namespace std;
long long c[100100], sum, ans;
set<int> st;
int id[100100], pre[100100], suc[100100];
int n, k;
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> c[i];
    pre[i] = i - 1;
    suc[i] = i + 1;
  }
  pre[1] = n;
  suc[n] = 1;
  for (int i = 1; i < n; i++) {
    sum += c[i];
    ans += c[i] * c[i + 1];
  }
  sum += c[n];
  ans += c[1] * c[n];
  long long imp = 0;
  while (k--) {
    int x;
    cin >> x;
    long long cur = sum;
    cur -= c[x];
    if (st.find(pre[x]) != st.end()) {
      cur += c[pre[x]];
    }
    if (st.find(suc[x]) != st.end()) {
      cur += c[suc[x]];
    }
    cur -= imp + c[pre[x]] + c[suc[x]];
    ans += cur * c[x];
    imp += c[x];
    st.insert(x);
  }
  cout << ans << endl;
  return 0;
}
