#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, sum = 0, tmp = 0;
  cin >> n >> m;
  long long arr[n], ind[m];
  for (long long i = 0; i < n; ++i) {
    cin >> arr[i];
    sum += arr[i];
  }
  for (long long i = 0; i < m; ++i) {
    cin >> ind[i];
  }
  vector<long long> auc_que;
  for (long long i = 0; i < m; ++i) {
    auc_que.push_back(arr[ind[i] - 1]);
    tmp += arr[ind[i] - 1];
  }
  sum -= tmp;
  sort(auc_que.begin(), auc_que.end());
  long long mx = LLONG_MIN;
  tmp = sum;
  while (!auc_que.empty()) {
    if (sum > auc_que[0]) {
      tmp += tmp;
      auc_que.erase(auc_que.begin());
    } else {
      tmp += auc_que[auc_que.size() - 1];
      auc_que.erase(auc_que.end() - 1);
    }
  }
  mx = max(mx, tmp);
  tmp = 0;
  for (long long i = m - 1; i >= 0; --i) {
    tmp += auc_que[i];
    long long tmp_sum = sum + tmp;
    for (long long j = 0; j < i; ++j) {
      tmp_sum += tmp_sum;
    }
    mx = max(mx, tmp_sum);
  }
  cout << mx;
  return 0;
}
