#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
long long n = 1000001;
bool prime[1000001];
long long max(long long a, long long b) {
  if (a >= b) {
    return a;
  }
  return b;
}
void solve() {
  long long n, m;
  cin >> n >> m;
  vector<long long> input;
  long long sum = 0;
  for (long long i = 0; i < n; i++) {
    long long x;
    cin >> x;
    sum += x;
    input.push_back(x);
  }
  vector<long long> auctions;
  for (long long i = 0; i < m; i++) {
    long long index;
    cin >> index;
    sum -= input[index - 1];
    auctions.push_back(input[index - 1]);
  }
  sort(auctions.begin(), auctions.end(), greater<long long>());
  for (long long i = 0; i < m; i++) {
    sum += max(sum, auctions[i]);
  }
  cout << sum << "\n";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  while (t > 0) {
    t--;
    solve();
  }
}
