#include <bits/stdc++.h>
using namespace std;

const int MAX_N = 5E5 + 100;

int n;
int a[MAX_N];

int m, m0;
int ans[MAX_N];

int main() {
    ifstream IN("input"), OUT("user_out"), ANS("answer");
    IN >> n;
    for (int i = 1; i <= n; ++i) {
        IN >> a[i];
    }

    ANS >> m0;
    if (OUT >> m) {
        if (m != m0) {
            cout << 0 << endl;
            return 0;
        }
        for (int i = 1; i <= m; ++i) {
            OUT >> ans[i];
        }
        for (int i = 2; i <= m; ++i) {
            if (a[ans[i]] < a[ans[i - 1]]) {
                cout << 0 << endl;
                return 0;
            }
        }
        while (OUT >> m) {
            cout << 0 << endl;
            return 0;
        }
    } else {
        cout << 0 << endl;
    }

    cout << 100 << endl;

    return 0;
}
