#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, k, x, sum = 0, ans = 0;
  cin >> n >> k;
  long long int arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    sum = sum + arr[i];
  }
  for (int i = 0; i < k; i++) {
    cin >> x;
    sum = sum - arr[x - 1];
    ans = ans + (sum) * (arr[x - 1]);
    arr[x - 1] = 0;
  }
  for (int i = 0; i <= n - 2; i++) {
    ans = ans + arr[i] * arr[i + 1];
  }
  ans = ans + arr[0] * arr[n - 1];
  cout << ans << "\n";
  return 0;
}
