#include <bits/stdc++.h>
using namespace std;
const int INF = INT_MAX;
const long long INFL = LLONG_MAX;
const long double pi = acos(-1);
int N, M;
long long A[1000];
vector<int> auction;
int main() {
  ios_base::sync_with_stdio(0);
  cout.precision(15);
  cout << fixed;
  cout.tie(0);
  cin.tie(0);
  cin >> N >> M;
  for (int(i) = 1, j123 = N; (i) <= j123; (i)++) cin >> A[i];
  for (int(i) = 1, j123 = M; (i) <= j123; (i)++) {
    int b;
    cin >> b;
    auction.push_back(A[b]);
    A[b] = 0;
  }
  long long basescore = 0;
  for (int(i) = 1, j123 = N; (i) <= j123; (i)++) basescore += A[i];
  sort(auction.begin(), auction.end());
  long long bestscore = 0;
  for (int numadd = 0; numadd <= int(auction.size()); numadd++) {
    long long score = basescore;
    int last = int(auction.size()) - 1;
    for (int(ii) = 0, j123 = numadd; (ii) < j123; (ii)++) {
      score += auction[last];
      last--;
    }
    int good = 1;
    for (int ii = 0; ii <= last; ii++) {
      if (score > auction[ii])
        score *= 2;
      else
        good = 0;
    }
    if (good) {
      bestscore = max(bestscore, score);
    }
  }
  cout << bestscore << '\n';
}
