#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int64_t n, k, s = 0, ans = 0;
  cin >> n >> k;
  vector<int64_t> a(n), b(k);
  for (int64_t i = 0; i < n; ++i) {
    cin >> a[i];
    s += a[i];
  }
  for (int64_t i = 0; i < k; ++i) {
    cin >> b[i];
    ans += a[b[i] - 1] * (s - a[b[i] - 1]);
    s -= a[b[i] - 1];
  }
  for (auto& x : b) a[x - 1] = 0;
  a.push_back(a.front());
  for (int64_t i = 0; i < n; ++i) ans += a[i] * a[i + 1];
  cout << ans;
}
