#include #include #include #include #include #include using namespace std; using i32 = int; using u32 = unsigned int; using i64 = long long; using u64 = unsigned long long; #define rep(i,n) for(int i=0; i<(int)(n); i++) const i64 INF = 1001001001001001001; i64 GCD(i64 a, i64 b){ return b ? GCD(b,a%b) : a; } using Modint = atcoder::static_modint<998244353>; int main(){ int N, M; cin >> N >> M; map Q0; vector E(40, 0); rep(i,M){ int u, v; cin >> u >> v; u--; v--; E[i] = (1ll << u) ^ (1ll << v); } i64 C = 0; rep(i,N){ int a; cin >> a; C |= (i64)a << i; } rep(i,1<<20){ i64 q = 0; rep(j,20) if(i&(1<second = min(I->second, f); } int ans = 1001001; rep(i,1<<20){ int q = 0; rep(j,20) if(i&(1<second); } if(ans >= 10000) ans = -1; cout << ans << endl; return 0; } struct ios_do_not_sync{ ios_do_not_sync(){ ios::sync_with_stdio(false); cin.tie(nullptr); } } ios_do_not_sync_instance;