#include <bits/stdc++.h>
using namespace std;
int n, m, vis[100100];
bool x[100100];
vector<int> ans, g[100100];
void dfs(int v) {
  vis[v]++, ans.push_back(v);
  for (int i = 0; i < g[v].size(); i++)
    if (!vis[g[v][i]]) {
      dfs(g[v][i]);
      if ((vis[g[v][i]] ^ x[g[v][i]]) & 1)
        vis[v]++, ans.push_back(v), vis[g[v][i]]++, ans.push_back(g[v][i]),
            vis[v]++, ans.push_back(v);
      else
        vis[v]++, ans.push_back(v);
    }
}
int main() {
  cin >> n >> m;
  for (int v, u, i = m; i--;
       cin >> v >> u, g[v].push_back(u), g[u].push_back(v))
    ;
  for (int i = 1; i <= n; cin >> x[i], i++)
    ;
  for (int i = 1; i <= n; i++)
    if (x[i]) {
      dfs(i);
      if ((vis[i] ^ x[i]) & 1)
        if (g[i].size())
          vis[g[i][0]]++, ans.push_back(g[i][0]), vis[i]++, ans.push_back(i),
              vis[g[i][0]]++, ans.push_back(g[i][0]);
      break;
    }
  for (int i = 1; i <= n; i++)
    if ((vis[i] ^ x[i]) & 1) cout << -1 << endl, exit(0);
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); cout << ans[i] << " ", i++)
    ;
  cout << endl;
  exit(0);
}
