func_code_string: #include <bits/stdc++.h>   using namespace std;   mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());   using ll = long long;   template <typename T>   void DEBUG(string label, T value) {     cerr <<  [  << label <<   =   << value <<  ] n ;   }   const int oo = 1 << 30;   void solve() {     int n;     cin >> n;     int bsize;     cin >> bsize;     vector<int> arr(n + 2);     for (int i = 1; i <= n; ++i) {       cin >> arr[i];       arr[i] -= i;     }     arr[0] = -oo;     arr[n + 1] = oo;     vector<int> b(bsize + 2);     for (int i = 1; i <= bsize; ++i) {       cin >> b[i];     }     b[0] = 0;     b[bsize + 1] = n + 1;     bsize += 2;     n += 2;     int ans = 0;     for (int i = 0; i < bsize - 1; ++i) {       if (arr[b[i]] > arr[b[i + 1]]) {         cout << -1 <<   n ;         return;       }       vector<int> dp;       for (int j = b[i] + 1; j < b[i + 1]; ++j) {         auto u = upper_bound(dp.begin(), dp.end(), arr[j]);         if (arr[j] >= arr[b[i]] && arr[j] <= arr[b[i + 1]]) {           if (u == dp.end()) {             dp.push_back(arr[j]);           } else {             *u = arr[j];           }         }       }       ans += b[i + 1] - b[i] - 1 - (int)dp.size();     }     cout << ans <<   n ;   }   int main() {     ios::sync_with_stdio(false);     cin.tie(nullptr);     int t = 1;     while (t--) solve();   }   