#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, i, j, k, sum = 0, cnt = 0, a[101];
  cin >> n >> m;
  vector<long long int> o;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  for (i = 0; i < m; i++) {
    cin >> j;
    j--;
    sum -= a[j];
    o.push_back(a[j]);
  }
  sort(o.rbegin(), o.rend());
  for (i = 0; i < m; i++) {
    if (o[i] < sum)
      sum += sum;
    else
      sum += o[i];
  }
  cout << sum;
}
