Problem: Bob is a farmer. He has a large pasture with many sheep. Recently, he has lost some of them due to wolf attacks. He thus decided to place some shepherd dogs in such a way that all his sheep are protected.

The pasture is a rectangle consisting of R × C cells. Each cell is either empty, contains a sheep, a wolf or a dog. Sheep and dogs always stay in place, but wolves can roam freely around the pasture, by repeatedly moving to the left, right, up or down to a neighboring cell. When a wolf enters a cell with a sheep, it consumes it. However, no wolf can enter a cell with a dog.

Initially there are no dogs. Place dogs onto the pasture in such a way that no wolf can reach any sheep, or determine that it is impossible. Note that since you have many dogs, you do not need to minimize their number. 

Input

First line contains two integers R (1 ≤ R ≤ 500) and C (1 ≤ C ≤ 500), denoting the number of rows and the numbers of columns respectively.

Each of the following R lines is a string consisting of exactly C characters, representing one row of the pasture. Here, 'S' means a sheep, 'W' a wolf and '.' an empty cell.

Output

If it is impossible to protect all sheep, output a single line with the word "No".

Otherwise, output a line with the word "Yes". Then print R lines, representing the pasture after placing dogs. Again, 'S' means a sheep, 'W' a wolf, 'D' is a dog and '.' an empty space. You are not allowed to move, remove or add a sheep or a wolf.

If there are multiple solutions, you may print any of them. You don't have to minimize the number of dogs.

Examples

Input

6 6
..S...
..S.W.
.S....
..W...
...W..
......


Output

Yes
..SD..
..SDW.
.SD...
.DW...
DD.W..
......


Input

1 2
SW


Output

No


Input

5 5
.S...
...S.
S....
...S.
.S...


Output

Yes
.S...
...S.
S.D..
...S.
.S...

Note

In the first example, we can split the pasture into two halves, one containing wolves and one containing sheep. Note that the sheep at (2,1) is safe, as wolves cannot move diagonally.

In the second example, there are no empty spots to put dogs that would guard the lone sheep.

In the third example, there are no wolves, so the task is very easy. We put a dog in the center to observe the peacefulness of the meadow, but the solution would be correct even without him.

Solution (in JAVA):

Solution:
import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.util.*;
import java.util.Map.Entry;

public class Main
{
	private InputStream stream;
	private byte[] buf = new byte[1024];
	private int curChar;
	private int numChars;
	private SpaceCharFilter filter;
	private PrintWriter pw;
	private long mod = 1000000000
			+ 7;

	private StringBuilder ans_sb;
	private int sum = 0;

	private void soln()
	{
		int n = nextInt();
		int m = nextInt();
		char[][] arr = new char[n
				+ 2][m + 2];
		for (int i = 1; i <= n; i++)
		{
			String s = nextLine();
			for (int j = 1; j <= m; j++)
				arr[i][j] = s
						.charAt(j
								- 1);
			// arr[i] = nextLine().toCharArray();
		}
		char[][] ne = new char[n
				+ 2][m + 2];
		// debug(arr);
		boolean f = false;
		for (int i = 1; i <= n; i++)
		{
			for (int j = 1; j <= m; j++)
			{
				if (arr[i][j] == 'S')
				{
					ne[i][j] = 'S';
					if (arr[i
							- 1][j] == 'W'
							|| arr[i][j
									- 1] == 'W'
							|| arr[i][j
									+ 1] == 'W'
							|| arr[i + 1][j] == 'W')
						f = true;
					if (arr[i
							- 1][j] != 'S')
						ne[i - 1][j] = 'D';
					if (arr[i
							+ 1][j] != 'S')
						ne[i + 1][j] = 'D';
					if (arr[i][j
							- 1] != 'S')
						ne[i][j - 1] = 'D';
					if (arr[i][j
							+ 1] != 'S')
						ne[i][j + 1] = 'D';
				} else if (arr[i][j] == 'W')
					ne[i][j] = 'W';
				else if (arr[i][j] == '.'
						&& ne[i][j] != 'D')
					ne[i][j] = '.';
			}
		}
		if (f)
			pw.println(
					"No");
		else
		{
			pw.println(
					"Yes");
			for (int i = 1; i <= n; i++)
			{
				for (int j = 1; j <= m; j++)
					pw.print(
							ne[i][j]);
				pw.println();
			}
		}
	}

	public class Segment
	{
		private int[] base;
		private Node[] tree;
		private boolean[] lazy;
		private int size;
		private int n;

		private class Node
		{
			private int size;
			private int[] arr;
		}

		public Segment(
				int[] arr,
				int n)
		{
			this.base = arr;
			int x = (int) (Math
					.ceil(Math
							.log(n)
							/ Math.log(
									2)));
			size = 2 * (int) Math
					.pow(2, x)
					- 1;
			tree = new Node[size];
			// lazy = new boolean[size];
			this.n = n;
			// this.set = set1;
			build(0, 0,
					n - 1);
		}

		public void build(
				int id,
				int l,
				int r)
		{
			if (l == r)
			{
				tree[id] = new Node();
				tree[id].size = 1;
				tree[id].arr = new int[1];
				tree[id].arr[0] = base[l];
				return;
			}
			int mid = ((l
					+ r) >> 1);
			build((id << 1)
					| 1,
					l,
					mid);
			build((id << 1)
					+ 2,
					mid + 1,
					r);
			tree[id] = merge(
					tree[(id << 1)
							| 1],
					tree[(id << 1)
							+ 2]);
			// System.out.println(l+" "+r+" "+tree[id].l+" "+tree[id].r+" "+tree[id].ans);
		}

		public Node merge(
				Node n1,
				Node n2)
		{
			Node ret = new Node();
			if (n1 == null
					&& n2 == null)
				return null;
			else if (n1 == null)
			{
				ret.size = n2.size;
				ret.arr = n2.arr
						.clone();
			} else if (n2 == null)
			{
				ret.size = n1.size;
				ret.arr = n1.arr
						.clone();
			} else
			{
				ret.size = Math
						.min(n1.size
								+ n2.size,
								60);
				ret.arr = new int[ret.size];
				int i1 = 0;
				int i2 = 0;
				int i = 0;
				while (i1 < n1.size
						&& i2 < n2.size
						&& i < ret.size)
				{
					if (n1.arr[i1] >= n2.arr[i2])
						ret.arr[i++] = n1.arr[i1++];
					else
						ret.arr[i++] = n2.arr[i2++];
				}
				while (i1 < n1.size
						&& i < ret.size)
					ret.arr[i++] = n1.arr[i1++];
				while (i2 < n2.size
						&& i < ret.size)
					ret.arr[i++] = n2.arr[i2++];
			}
			return ret;
		}

		public int[] query(
				int l,
				int r)
		{
			Node ret = queryUtil(
					l,
					r,
					0,
					0,
					n - 1);
			if (ret == null)
				return new int[] {};
			else
				return ret.arr;
		}

		private Node queryUtil(
				int x,
				int y,
				int id,
				int l,
				int r)
		{
			if (l > y
					|| x > r)
				return null;
			if (x <= l
					&& r <= y)
			{
				return tree[id];
			}
			int mid = ((l
					+ r) >> 1);
			// shift(id);
			Node q1 = queryUtil(
					x,
					y,
					(id << 1)
							| 1,
					l,
					mid);
			Node q2 = queryUtil(
					x,
					y,
					(id << 1)
							+ 2,
					mid + 1,
					r);
			return merge(
					q1,
					q2);
		}

		public void update(
				int x,
				int y,
				int c)
		{
			update1(x,
					y,
					c,
					0,
					0,
					n - 1);
		}

		private void update1(
				int x,
				int y,
				int colour,
				int id,
				int l,
				int r)
		{
			// System.out.println(l+" "+r+" "+x);
			if (x > r
					|| y < l)
				return;
			if (x <= l
					&& r <= y)
			{
				tree[id].arr[0] = colour;
				return;
			}
			int mid = ((l
					+ r) >> 1);
			// shift(id);
			if (y <= mid)
				update1(x,
						y,
						colour,
						(id << 1)
								| 1,
						l,
						mid);
			else if (x > mid)
				update1(x,
						y,
						colour,
						(id << 1)
								+ 2,
						mid + 1,
						r);
			else
			{
				update1(x,
						y,
						colour,
						(id << 1)
								| 1,
						l,
						mid);
				update1(x,
						y,
						colour,
						(id << 1)
								+ 2,
						mid + 1,
						r);
			}
			tree[id] = merge(
					tree[(id << 1)
							| 1],
					tree[(id << 1)
							+ 2]);

		}

		public void shift(
				int id)
		{

		}
	}

	class BitsetLong
	{

		static final int LOG = 6;
		static final int SIZE = 1 << LOG;
		static final int MASK = SIZE
				- 1;

		private long[] data;

		public BitsetLong(
				int n)
		{
			data = new long[(n >> LOG)
					+ 2];
		}

		void set(
				int i)
		{
			data[i >> LOG] |= 1L << (i
					& MASK);
		}

		void unset(
				int i)
		{
			data[i >> LOG] &= ~(1L << (i
					& MASK));
		}

		void flip(
				int i)
		{
			data[i >> LOG] ^= 1L << (i
					& MASK);
		}

		int get(int i)
		{
			return (int) ((data[i >> LOG] >>> (i
					& MASK))
					& 1);
		}

		void print()
		{
			for (int i = 0; i < data.length; i++)
			{
				System.out
						.print(Long
								.toString(
										data[i],
										2));
			}
			System.out
					.println();
		}

		long getWord(
				int i)
		{
			if (i <= -SIZE
					|| (i >> LOG)
							+ 1 >= data.length)
			{
				return 0;
			}
			int rem = i
					& MASK;
			int idx = i >> LOG;

			if (rem == 0)
			{
				return data[idx];
			}

			long head = idx < 0
					? 0
					: (data[idx] >>> rem);
			long tail = data[idx
					+ 1] << (SIZE
							- rem);

			return head
					| tail;
		}
	}

	int count(
			long[] bs,
			int len)
	{
		int ret = 0;
		for (int i = 0; i << 6 < len; i++)
		{
			if (((i + 1) << 6) <= len)
			{
				ret += Long
						.bitCount(
								bs[i]);
			} else
			{
				int rem = len
						& 63;
				ret += Long
						.bitCount(
								bs[i] << (64
										- rem));
			}
		}
		return ret;
	}

	private class Pair
			implements
			Comparable<Pair>
	{
		int i, j;

		public Pair(
				int b,
				int c)
		{

			i = b;
			j = c;
		}

		@Override
		public int compareTo(
				Pair arg0)
		{
			return this.i
					- arg0.i;
		}
	}

	private class Bridge
	{
		private LinkedList<Edge>[] graph;
		private LinkedList<Integer>[] tree;
		private int t;
		private boolean[] isBridge;
		private int[] cno;

		public Bridge(
				int n,
				int m)
		{
			pre(n, m);
		}

		private class Edge
		{
			int u, v,
					i;

			public Edge(
					int a,
					int b,
					int c)
			{
				u = a;
				v = b;
				i = c;
			}
		}

		private void pre(
				int n,
				int m)
		{
			graph = new LinkedList[n];
			tree = new LinkedList[n];
			for (int i = 0; i < m; i++)
			{
				int u = nextInt()
						- 1;
				int v = nextInt()
						- 1;
				Edge e = new Edge(
						u,
						v,
						i);
				graph[u].add(
						e);
				graph[v].add(
						e);
			}
			isBridge = new boolean[m];
			cno = new int[n];
			boolean[] v = new boolean[n];
			int[] arr = new int[n];
			for (int i = 0; i < n; i++)
				if (!v[i])
					dfs(i, null,
							v,
							arr);
		}

		private int dfs(
				int u,
				Edge e,
				boolean[] v,
				int[] arr)
		{
			v[u] = true;
			arr[u] = t++;
			int min = arr[u];
			Iterator<Edge> it = graph[u]
					.listIterator();
			while (it
					.hasNext())
			{
				Edge x = it
						.next();
				int w = x.u;
				if (x.u == u)
					w = x.v;
				if (!v[w])
					min = Math
							.min(min,
									dfs(w, x,
											v,
											arr));
				else if (x != e)
					min = Math
							.min(min,
									arr[w]);
			}
			if (min == arr[u]
					&& e != null)
				isBridge[e.i] = true;
			return min;
		}

		private void bfs(
				int u,
				int cmpNo,
				Queue<Integer>[] q,
				boolean[] v)
		{
			int cur = cmpNo;
			cno[cur] = cmpNo;
			q[cur].add(
					u);
			v[u] = true;
			while (!q[cur]
					.isEmpty())
			{
				int x = q[cur]
						.poll();
				Iterator<Edge> it = graph[x]
						.listIterator();
				while (it
						.hasNext())
				{
					Edge x1 = it
							.next();
					int w = x1.u;
					if (w == x)
						w = x1.v;
					if (!v[w])
					{
						if (isBridge[x1.i])
						{
							tree[cur]
									.add(0, cmpNo
											+ 1);
							tree[cmpNo
									+ 1].add(
											0,
											cur);
							bfs(w, cmpNo
									+ 1,
									q,
									v);
						} else
						{
							bfs(w, cmpNo,
									q,
									v);
						}
					}
				}
			}
		}
	}

	private String solveEqn(
			long a,
			long b)
	{
		long x = 0,
				y = 1,
				lastx = 1,
				lasty = 0,
				temp;
		while (b != 0)
		{
			long q = a
					/ b;
			long r = a
					% b;
			a = b;
			b = r;
			temp = x;
			x = lastx
					- q * x;
			lastx = temp;
			temp = y;
			y = lasty
					- q * y;
			lasty = temp;
		}
		return lastx
				+ " "
				+ lasty;
	}

	private void debug(
			Object... o)
	{
		System.out
				.println(
						Arrays.deepToString(
								o));
	}

	private long pow(
			long a,
			long b,
			long c)
	{
		if (b == 0)
			return 1;
		long p = pow(
				a,
				b / 2,
				c);
		p = (p * p)
				% c;
		return (b
				% 2 == 0)
						? p
						: (a * p)
								% c;
	}

	private long gcd(
			long n,
			long l)
	{
		if (l == 0)
			return n;
		return gcd(
				l,
				n % l);
	}

	public static void main(
			String[] args)
			throws Exception
	{
		new Thread(
				null,
				new Runnable()
				{
					@Override
					public void run()
					{
						new Main()
								.solve();
					}
				},
				"1",
				1 << 26).start();
		// new Main().solve();
	}

	public StringBuilder solve()
	{
		InputReader(
				System.in);
		/*
		 * try { InputReader(new FileInputStream("C:\\Users\\hardik\\Desktop\\in.txt"));
		 * } catch(FileNotFoundException e) {}
		 */
		pw = new PrintWriter(
				System.out);
		// ans_sb = new StringBuilder();
		soln();

		pw.close();
		// System.out.println(ans_sb);
		return ans_sb;
	}

	public void InputReader(
			InputStream stream1)
	{
		stream = stream1;
	}

	private boolean isWhitespace(
			int c)
	{
		return c == ' '
				|| c == '\n'
				|| c == '\r'
				|| c == '\t'
				|| c == -1;
	}

	private boolean isEndOfLine(
			int c)
	{
		return c == '\n'
				|| c == '\r'
				|| c == -1;
	}

	private int read()
	{
		if (numChars == -1)
			throw new InputMismatchException();
		if (curChar >= numChars)
		{
			curChar = 0;
			try
			{
				numChars = stream
						.read(buf);
			} catch (IOException e)
			{
				throw new InputMismatchException();
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}

	private int nextInt()
	{
		int c = read();
		while (isSpaceChar(
				c))
			c = read();
		int sgn = 1;
		if (c == '-')
		{
			sgn = -1;
			c = read();
		}
		int res = 0;
		do
		{
			if (c < '0'
					|| c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(
				c));
		return res
				* sgn;
	}

	private long nextLong()
	{
		int c = read();
		while (isSpaceChar(
				c))
			c = read();
		int sgn = 1;
		if (c == '-')
		{
			sgn = -1;
			c = read();
		}
		long res = 0;
		do
		{
			if (c < '0'
					|| c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(
				c));
		return res
				* sgn;
	}

	private String nextToken()
	{
		int c = read();
		while (isSpaceChar(
				c))
			c = read();
		StringBuilder res = new StringBuilder();
		do
		{
			res.appendCodePoint(
					c);
			c = read();
		} while (!isSpaceChar(
				c));
		return res
				.toString();
	}

	private String nextLine()
	{
		int c = read();
		while (isSpaceChar(
				c))
			c = read();
		StringBuilder res = new StringBuilder();
		do
		{
			res.appendCodePoint(
					c);
			c = read();
		} while (!isEndOfLine(
				c));
		return res
				.toString();
	}

	private int[] nextIntArray(
			int n)
	{
		int[] arr = new int[n];
		for (int i = 0; i < n; i++)
		{
			arr[i] = nextInt();
		}
		return arr;
	}

	private long[] nextLongArray(
			int n)
	{
		long[] arr = new long[n];
		for (int i = 0; i < n; i++)
		{
			arr[i] = nextLong();
		}
		return arr;
	}

	private void pArray(
			int[] arr)
	{
		for (int i = 0; i < arr.length; i++)
		{
			System.out
					.print(arr[i]
							+ " ");
		}
		System.out
				.println();
		return;
	}

	private void pArray(
			long[] arr)
	{
		for (int i = 0; i < arr.length; i++)
		{
			System.out
					.print(arr[i]
							+ " ");
		}
		System.out
				.println();
		return;
	}

	private boolean isSpaceChar(
			int c)
	{
		if (filter != null)
			return filter
					.isSpaceChar(
							c);
		return isWhitespace(
				c);
	}

	private char nextChar()
	{
		int c = read();
		while (isSpaceChar(
				c))
			c = read();
		char c1 = (char) c;
		while (!isSpaceChar(
				c))
			c = read();
		return c1;
	}

	private interface SpaceCharFilter
	{
		public boolean isSpaceChar(
				int ch);
	}
}