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