#include <bits/stdc++.h>
using namespace std;
long long int n, m, d[1000], v[1000], x[1000], q, r, t;
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> d[i];
  for (int i = 1; i <= m; i++) {
    cin >> v[i];
    q++;
    x[q] = d[v[i]];
    d[v[i]] = 0;
  }
  sort(x, x + q + 1);
  for (int i = 1; i <= n; i++) t += d[i];
  for (int i = q; i >= 1; i--) {
    if (x[i] < t)
      t += t;
    else
      t += x[i];
  }
  cout << t << endl;
  return 0;
}
