#include <bits/stdc++.h>
using namespace std;
unsigned long long int prices[200];
bool isAuction[200];
vector<unsigned long long int> auctions;
int main() {
  ios_base::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> prices[i];
  for (int i = 0; i < m; i++) {
    int b;
    cin >> b;
    isAuction[b - 1] = 1;
    auctions.push_back(prices[b - 1]);
  }
  unsigned long long int res = 0;
  for (int i = 0; i < n; i++) {
    unsigned long long int p = prices[i];
    if (!isAuction[i]) res += p;
  }
  sort(auctions.rbegin(), auctions.rend());
  for (unsigned long long int a : auctions) {
    if (res > a) a = res;
    res += a;
  }
  cout << res << '\n';
}
