#include using namespace std; using ll = long long; #define rep(i, n) for(int i = 0; i < n; i++) int main() { int N, T, K; cin >> N >> T; vector t(N - 1); rep(i, N - 1) cin >> t[i]; cin >> K; vector x(N); rep(i, K) { int a; cin >> a; x[a - 1] = 1; } int now = T, ans = 0, cnt = 0; rep(i, N - 1) { if(now && x[i]) { cnt++; } if(now - t[i] <= 0) { while(cnt && now - t[i] <= 0) { now += 10; ans++; cnt--; } now -= t[i]; if(now <= 0) { cout << -1 << endl; return 0; } } else now -= t[i]; } cout << ans << endl; }