#include <bits/stdc++.h>
using namespace std;
int cmp(int a, int b) { return a > b; }
int prices[110], aqnumber[110];
int main() {
  int n, m, i, t;
  long long sum;
  cin >> n >> m;
  memset(prices, 0, sizeof(prices));
  memset(aqnumber, 0, sizeof(aqnumber));
  sum = 0;
  for (i = 0; i < n; i++) {
    cin >> prices[i];
    sum += prices[i];
  }
  for (i = 0; i < m; i++) {
    cin >> t;
    aqnumber[t - 1] = prices[t - 1];
    sum -= prices[t - 1];
  }
  sort(aqnumber, aqnumber + n, cmp);
  for (i = 0; i < m; i++) {
    if (sum >= aqnumber[i]) {
      sum = sum * 2;
    } else {
      sum += aqnumber[i];
    }
  }
  cout << sum << endl;
  return 0;
}
