#include <bits/stdc++.h>
using namespace std;
int a, b;
int main() {
  long long ans = 0, sum = 0;
  scanf("%d %d", &a, &b);
  int x[a + 1], y[b];
  for (int i = 0; i < a; i++) {
    scanf("%d", &x[i]);
    sum += x[i];
  }
  x[a] = x[0];
  for (int i = 0; i < b; i++) {
    scanf("%d", &y[i]);
    y[i]--;
  }
  for (int i = 0; i < a; i++) ans += x[i] * x[i + 1];
  for (int i = 0; i < b; i++) {
    ans += x[y[i]] * (sum - x[y[i]]);
    if (y[i] != 0)
      ans -= x[y[i]] * (x[y[i] - 1] + x[y[i] + 1]);
    else
      ans -= x[y[i]] * (x[a - 1] + x[y[i] + 1]);
    sum -= x[y[i]];
  }
  for (int i = 0; i < b - 1; i++) {
    if (y[i + 1] == y[i] + 1) ans += x[y[i]] * x[y[i + 1]];
  }
  if (y[0] == 0 && y[b - 1] == a - 1) ans += x[0] * x[a - 1];
  printf("%I64d", ans);
  return 0;
}
