#include <bits/stdc++.h>
using namespace std;
long long n, k, b[100001], cost = 0, totalTaken = 0;
map<int, int> capital;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> k;
  b[0] = 0;
  for (int i = 1; i <= n; ++i) {
    cin >> b[i];
    totalTaken += b[i];
    capital[i] = 0;
    cost += b[i] * b[i - 1];
  }
  cost += b[1] * b[n];
  for (int j = 0; j < k; j++) {
    int c;
    cin >> c;
    totalTaken -= b[c];
    long long newTotal = totalTaken;
    if (c == 1) {
      if (capital[n] == 0) newTotal -= b[n];
      if (capital[2] == 0) newTotal -= b[2];
    } else if (c == n) {
      if (capital[n - 1] == 0) newTotal -= b[n - 1];
      if (capital[1] == 0) newTotal -= b[1];
    } else {
      if (capital[c + 1] == 0) newTotal -= b[c + 1];
      if (capital[c - 1] == 0) newTotal -= b[c - 1];
    }
    capital[c] = 1;
    cost += b[c] * newTotal;
  }
  cout << cost;
}
