#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 77, inf = 1e9 + 77;
const long double eps = 1e-9;
int a[N], c[N];
long long sum, ans;
bool is[N];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &c[i]);
    sum += c[i];
  }
  for (int i = 1; i <= m; i++) {
    scanf("%d", &a[i]);
    is[a[i]] = 1;
    sum -= c[a[i]];
    ans += sum * c[a[i]];
  }
  for (int i = 1; i < n; i++) {
    if (!is[i] && !is[i + 1]) {
      ans += 1LL * c[i] * c[i + 1];
    }
  }
  if (!is[1] && !is[n]) {
    ans += 1LL * c[1] * c[n];
  }
  cout << ans << endl;
}
