#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int a[101];
  long long s = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    s = s + a[i];
  }
  int au[101];
  for (int i = 1; i <= m; i++) {
    int x;
    cin >> x;
    au[i] = a[x];
    s = s - a[x];
  }
  sort(au + 1, au + m + 1);
  for (int i = m; i >= 1; i--)
    if (au[m] > s)
      s = s + 1LL * au[m];
    else
      s = s * 2;
  cout << s << endl;
  return 0;
}
