#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  cin >> a >> b;
  int A[a];
  long long sum = 0;
  for (int i = 0; i < a; i++) {
    cin >> A[i];
    sum = sum + A[i];
  }
  int B[b];
  for (int i = 0; i < b; i++) {
    int g;
    cin >> g;
    B[i] = A[g - 1];
    sum = sum - A[g - 1];
  }
  sort(B, B + b, greater<int>());
  for (int i = 0; i < b; i++) {
    if (sum >= B[i]) {
      sum = sum * 2;
    } else {
      sum = sum + B[i];
    }
  }
  cout << sum << endl;
}
