#include <bits/stdc++.h>
using namespace std;
int OO = 1000000;
long long mod = 1000000007;
int main() {
  ios::sync_with_stdio(0);
  long long n, m;
  cin >> n >> m;
  long long a[n], b[m];
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int j = 0; j < m; j++) {
    cin >> b[j];
    b[j]--;
  }
  sort(b, b + m);
  long long v = 0, sum = 0;
  vector<int> vec;
  for (int i = 0; i < n; i++) {
    if (i == b[v]) {
      vec.push_back(a[i]);
      v++;
      continue;
    }
    sum += a[i];
  }
  sort(vec.begin(), vec.end());
  reverse(vec.begin(), vec.end());
  for (int i = 0; i < vec.size(); i++) {
    long long temp = sum;
    if (vec[i] > sum) temp = vec[i];
    sum += temp;
  }
  cout << sum;
}
