#include <bits/stdc++.h>
using namespace std;
long long n, m;
long long a[200];
long long b[200];
priority_queue<long long> pq;
long long cur;
int main() {
  cin >> n >> m;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    cur += a[i];
  }
  for (long long i = 1; i <= m; i++) {
    cin >> b[i];
    cur -= a[b[i]];
    pq.push(a[b[i]]);
  }
  while (pq.empty() == false) {
    long long u = pq.top();
    pq.pop();
    if (u >= cur) {
      cur += u;
    } else {
      cur += cur;
    }
  }
  cout << cur << endl;
  return 0;
}
