#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;
}
