#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 0, -1, 1, 1, 1, -1, -1};
int dy[] = {-1, 1, 0, 0, 1, -1, 1, -1};
void fast() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
}
int main() {
  fast();
  int n;
  cin >> n;
  int m;
  cin >> m;
  vector<int> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  vector<int> vm(m);
  for (int j = 0; j < m; j++) {
    cin >> vm[j];
    int temp = v[vm[j] - 1];
    v[vm[j] - 1] = 0;
    vm[j] = temp;
  }
  long long sum = 0;
  for (int i = 0; i < n; i++) sum += v[i];
  sort(vm.rbegin(), vm.rend());
  for (int i = 0; i < vm.size(); i++) sum += max(vm[i] * 1LL, sum);
  cout << sum;
}
