#include <bits/stdc++.h>
using namespace std;
const long long nax = 1e5 + 5;
vector<long long> adj[nax];
const long long mod = 1e9 + 7;
const long long inf = 1e18 + 7;
long long n, m;
long long a[nax], b[nax], c[nax];
map<long long, long long> M;
vector<pair<long long, long long>> v;
signed main() {
  cin >> n >> m;
  long long sum = 0;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  for (long long i = 0; i < m; i++) {
    long long x;
    cin >> x;
    x--;
    sum -= a[x];
    v.push_back({a[x], x});
  }
  sort(v.begin(), v.end());
  reverse(v.begin(), v.end());
  for (auto u : v) {
    if (u.first < sum)
      sum *= 2;
    else
      sum += u.first;
  }
  cout << sum << "\n";
  return 0;
}
