#include <bits/stdc++.h>
using namespace std;
pair<long long, bool> q[102];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  long long ans = 0;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> q[i].first;
    q[i].second = true;
  }
  for (int i = 0; i < m; i++) {
    int temp;
    cin >> temp;
    q[temp - 1].second = false;
  }
  sort(q, q + n);
  for (int i = 0; i < n; i++) {
    if (q[i].second) ans += q[i].first;
  }
  for (int i = n - 1; i >= 0; i--) {
    if (q[i].second == false) ans = max(ans * 2, ans + q[i].first);
  }
  cout << ans;
}
