#include <bits/stdc++.h>
using namespace std;
//Uzumaki Naruto :)
#define TRACE
#ifdef TRACE
#define dbgA(a,n) for(int i = 0; i < n; ++i) cerr << a[i] << " ";cerr << endl;
#define dbg(args...) {debug,args; cerr<<endl;}
#define pause() cin.get();cin.get();
#else
#define dbgA(a,n)
#define dbg(args...)
#define pause()
#endif
struct debugger {
template<typename T> debugger& operator , (const T& v) {
cerr<<v<<" "; return *this;
}
} debug;
template <typename T1, typename T2>
inline ostream& operator << (ostream& os, const pair<T1, T2>& p) {
return os << "(" << p.first << ", " << p.second << ")";
}
template<typename T>
inline ostream &operator << (ostream & os,const vector<T>& v) {
bool first = true; os << "[";
for (typename vector<T>::const_iterator ii = v.begin(); ii != v.end(); ++ii) {
if(!first) os << ", ";
os << *ii; first = false;
}
return os << "]";
}
typedef long long LL;
typedef pair<int,int> pii;
typedef vector<int> vi;
const int NN = 112345;
vector<int> g[NN],v[NN];
int ans[5*NN],p[NN],x[NN];
int N,M,tot = 0, cnt = 0;
bool vis[NN];
void build(int st){
if (!tot) return;
vis[st] = true;
tot -= p[st];
int sz = g[st].size();
for(int i = 0; i < sz; ++i){
int nw = g[st][i];
if (tot and !vis[nw]){
v[st].push_back(nw);
v[nw].push_back(st);
build(nw);
}
}
}
void path(int st,int pa,int b){
vis[st] = true;
x[st] ^= 1;
ans[cnt++] = st;
int sz = v[st].size();
if (!sz and (x[st]^p[st])){
ans[cnt++] = pa;
ans[cnt++] = st;
x[st] ^= 1;
x[pa] ^= 1;
}
for(int i = 0; i < sz; ++i){
int nw = v[st][i];
if (vis[nw]) continue;
path(nw,st,i+1);
}
if (pa != -1 and b < v[pa].size())
ans[cnt++] = pa, x[pa] ^= 1;
else if (pa != -1 and (x[pa]^p[pa]))
ans[cnt++] = pa, x[pa] ^= 1;
}
void solve(){
cin >> N >> M;
for(int i = 0; i < M; ++i){
int a,b;
cin >> a >> b;
g[a].push_back(b);
g[b].push_back(a);
}
for(int i = 1; i <= N; ++i)
cin >> p[i], tot += p[i];
int st = -1;
for(int i = 1; i <= N; ++i) if (p[i]){
st = i;
break;
}
//dbg(st);
build(st);
if (tot){
cout << "-1\n";
return;
}
memset(vis,false,sizeof(vis));
if (st != -1) path(st,-1,-1);
assert(cnt <= 4*N);
cout << cnt << endl;
for(int i = 0; i < cnt; ++i){
cout << ans[i];
if (i+1 < cnt) cout << " ";
else cout << endl;
}
}
int main()
{
//ios_base::sync_with_stdio(0);
//cin.tie(NULL);
solve();
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgovL1V6dW1ha2kgTmFydXRvIDopCiNkZWZpbmUgVFJBQ0UKCiNpZmRlZiBUUkFDRQojZGVmaW5lIGRiZ0EoYSxuKSAgICBmb3IoaW50IGkgPSAwOyBpIDwgbjsgKytpKSBjZXJyIDw8IGFbaV0gPDwgIiAiO2NlcnIgPDwgZW5kbDsKI2RlZmluZSBkYmcoYXJncy4uLikge2RlYnVnLGFyZ3M7IGNlcnI8PGVuZGw7fQojZGVmaW5lIHBhdXNlKCkgICAgICBjaW4uZ2V0KCk7Y2luLmdldCgpOwoKI2Vsc2UKI2RlZmluZSBkYmdBKGEsbikKI2RlZmluZSBkYmcoYXJncy4uLikKI2RlZmluZSBwYXVzZSgpCgojZW5kaWYKCnN0cnVjdCBkZWJ1Z2dlciB7CiAgICB0ZW1wbGF0ZTx0eXBlbmFtZSBUPiBkZWJ1Z2dlciYgb3BlcmF0b3IgLCAoY29uc3QgVCYgdikgewogICAgICAgIGNlcnI8PHY8PCIgIjsgcmV0dXJuICp0aGlzOwogICAgfQp9IGRlYnVnOwoKdGVtcGxhdGUgPHR5cGVuYW1lIFQxLCB0eXBlbmFtZSBUMj4KaW5saW5lIG9zdHJlYW0mIG9wZXJhdG9yIDw8IChvc3RyZWFtJiBvcywgY29uc3QgcGFpcjxUMSwgVDI+JiBwKSB7CiAgICByZXR1cm4gb3MgPDwgIigiIDw8IHAuZmlyc3QgPDwgI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IHBhdGgoaW50IHN0LGludCBwYSxpbnQgYil7CiAgICB2aXNbc3RdID0gdHJ1ZTsKICAgIHhbc3RdIF49IDE7CiAgICBhbnNbY250KytdID0gc3Q7CgogICAgaW50IHN6ID0gdltzdF0uc2l6ZSgpOwogICAgaWYgKCFzeiBhbmQgKHhbc3RdXnBbc3RdKSl7CiAgICAgICAgYW5zW2NudCsrXSA9IHBhOwogICAgICAgIGFuc1tjbnQrK10gPSBzdDsKICAgICAgICB4W3N0XSBePSAxOwogICAgICAgIHhbcGFdIF49IDE7CiAgICB9CgogICAgZm9yKGludCBpID0gMDsgaSA8IHN6OyArK2kpewogICAgICAgIGludCBudyA9IHZbc3RdW2ldOwogICAgICAgIGlmICh2aXNbbnddKSBjb250aW51ZTsKICAgICAgICBwYXRoKG53LHN0LGkrMSk7CiAgICB9CgogICAgaWYgKHBhICE9IC0xIGFuZCBiIDwgdltwYV0uc2l6ZSgpKQogICAgICAgIGFuc1tjbnQrK10gPSBwYSwgeFtwYV0gXj0gMTsKICAgIGVsc2UgaWYgKHBhICE9IC0xIGFuZCAoeFtwYV1ecFtwYV0pKQogICAgICAgIGFuc1tjbnQrK10gPSBwYSwgeFtwYV0gXj0gMTsKfQoKdm9pZCBzb2x2ZSgpewogICAgY2luID4+IE4gPj4gTTsKICAgIGZvcihpbnQgaSA9IDA7IGkgPCBNOyArK2kpewogICAgICAgIGludCBhLGI7CiAgICAgICAgY2luID4+IGEgPj4gYjsKICAgICAgICBnW2FdLnB1c2hfYmFjayhiKTsKICAgICAgICBnW2JdLnB1c2hfYmFjayhhKTsKICAgIH0KCiAgICBmb3IoaW50IGkgPSAxOyBpIDw9IE47ICsraSkKICAgICAgICBjaW4gPj4gcFtpXSwgdG90ICs9IHBbaV07CiAgICBpbnQgc3QgPSAtMTsKICAgIGZvcihpbnQgaSA9IDE7IGkgPD0gTjsgKytpKSBpZiAocFtpXSl7CiAgICAgICAgc3QgPSBpOwogICAgICAgIGJyZWFrOwogICAgfQoKICAgIC8vZGJnKHN0KTsKICAgIGJ1aWxkKHN0KTsKICAgIGlmICh0b3QpewogICAgICAgIGNvdXQgPDwgIi0xXG4iOwogICAgICAgIHJldHVybjsKICAgIH0KCiAgICBtZW1zZXQodmlzLGZhbHNlLHNpemVvZih2aXMpKTsKICAgIGlmIChzdCAhPSAtMSkgcGF0aChzdCwtMSwtMSk7CiAgICBhc3NlcnQoY250IDw9IDQqTik7CgogICAgY291dCA8PCBjbnQgPDwgZW5kbDsKICAgIGZvcihpbnQgaSA9IDA7IGkgPCBjbnQ7ICsraSl7CiAgICAgICAgY291dCA8PCBhbnNbaV07CiAgICAgICAgaWYgKGkrMSA8IGNudCkgY291dCA8PCAiICI7CiAgICAgICAgZWxzZSBjb3V0IDw8IGVuZGw7CiAgICB9Cn0KCmludCBtYWluKCkKewogICAgLy9pb3NfYmFzZTo6c3luY193aXRoX3N0ZGlvKDApOwogICAgLy9jaW4udGllKE5VTEwpOwogICAgc29sdmUoKTsKICAgIHJldHVybiAwOwp9Cg==