#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 28;
int n, m, k;
vector<int> vec[100010], ans;
int a[100010];
bool vis[100010];
void visit(int x) {
  ans.push_back(x);
  a[x] ^= 1;
  vis[x] = true;
}
void dfs(int u) {
  visit(u);
  for (int i = 0; i < (int)vec[u].size(); i++) {
    int v = vec[u][i];
    if (vis[v]) continue;
    dfs(v);
    visit(u);
    if (a[v]) {
      visit(v);
      visit(u);
    }
  }
}
int main() {
  while (cin >> n >> m) {
    int u, v;
    for (int i = 1; i <= m; i++) {
      scanf("%d%d", &u, &v);
      vec[u].push_back(v);
      vec[v].push_back(u);
    }
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]), a[i] = (a[i] > 0);
    for (int i = 1; i <= n; i++) {
      if (!a[i]) continue;
      dfs(i);
      if (a[i]) {
        ans.pop_back();
        a[i] = 0;
      }
      break;
    }
    if (count(a + 1, a + n + 1, 0) != n)
      puts("-1");
    else {
      cout << ans.size() << endl;
      for (int i = 0; i < (int)ans.size(); i++) {
        printf("%d%c", ans[i], i == (int)ans.size() - 1 ? '\n' : ' ');
      }
    }
  }
  return 0;
}
