#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n, m, b;
  cin >> n >> m;
  vector<int> v(n);
  for (i = 0; i < n; i++) cin >> v[i];
  vector<long long int> a;
  vector<bool> arr(n, false);
  for (i = 0; i < m; i++) {
    cin >> b;
    arr[b - 1] = true;
    a.push_back(1ll * v[b - 1]);
  }
  long long int ans = 0;
  sort(a.begin(), a.end());
  reverse(a.begin(), a.end());
  for (i = 0; i < n; i++)
    if (!arr[i]) ans += 1ll * v[i];
  for (i = 0; i < m; i++)
    if (ans > a[i])
      ans = 1ll * 2 * ans;
    else
      ans += a[i];
  cout << ans << endl;
  return 0;
}
