#include <bits/stdc++.h>
using namespace std;
int DEBUG = 0;
int main(int argc, char **argv) {
  DEBUG = (argc >= 2) ? atoi(argv[1]) : 0;
  int64_t m, n;
  cin >> n >> m;
  int64_t a[n];
  int64_t score = 0;
  for (int64_t i = 0; i < n; i++) {
    cin >> a[i];
    score += a[i];
  }
  int64_t auc[m];
  for (int64_t i = 0; i < m; i++) {
    int64_t t;
    cin >> t;
    auc[i] = a[t - 1];
    score -= auc[i];
  }
  sort(auc, auc + m);
  for (int64_t i = m - 1; i >= 0; i--) {
    if (score >= auc[i]) {
      score = score * 2;
    } else {
      score = score + auc[i];
    }
  }
  cout << score << endl;
  return 0;
}
