#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10, mod = 1e9 + 7;
const long long inf = 1e18 + 1;
bool zojiat[maxn];
bool check[maxn];
vector<int> adj[maxn];
int root;
vector<int> ans;
void dfs(int v) {
  check[v] = 1;
  zojiat[v] = !zojiat[v];
  ans.push_back(v);
  for (auto u : adj[v]) {
    if (check[u])
      continue;
    else {
      dfs(u);
      zojiat[v] = !zojiat[v];
      ans.push_back(v);
      if (zojiat[u]) {
        zojiat[u] = 0;
        zojiat[v] = !zojiat[v];
        ans.push_back(u);
        ans.push_back(v);
      }
    }
  }
  if (v == root) {
    if (zojiat[v]) ans.pop_back();
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  int did = 0;
  for (int i = 1; i <= n; i++) cin >> zojiat[i];
  for (int i = 1; i <= n; i++) {
    if (check[i]) continue;
    if (!zojiat[i]) continue;
    did++;
    root = i;
    dfs(i);
  }
  if (did > 1) {
    cout << -1;
    return 0;
  } else {
    cout << ans.size() << "\n";
    for (int i = 0; i < ans.size(); i++) cout << ans[i] << ' ';
  }
  return 0;
}
