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.util.*;
import static java.lang.Math.min;
import static java.lang.Math.abs;
import static java.lang.Math.max;
import java.io.*;

public class Codechef {
	static long[] mods = {1000000007, 998244353, 1000000009};
	static long mod = mods[0];
	public static MyScanner in;
    public static PrintWriter out;
    static int[][] dp;
    static ArrayList<ArrayList<Integer>> tree;
    static List<String> al = new ArrayList<>();
    
	public static void main( String[] args ) throws IOException{
		
 		in = new MyScanner();
 		out = new PrintWriter(System.out);
 		StringBuilder ans1=new StringBuilder();
		int test=1;
		while(test-->0) {
			int r=in.nextInt();
			int c=in.nextInt();
			//StringBuilder ans=new StringBuilder();
			String ans="YES";
			ArrayList<char[]> pasture=new ArrayList<>();
			for(int i=0;i<r;i++){
			     String x=in.next();
			     pasture.add(x.toCharArray());
			}
			
			for(int i=0;i<r;i++){
			     for(int j=0;j<c;j++){
			          if(pasture.get(i)[j]=='S'){
			               if(i>0 && pasture.get(i-1)[j]=='W'){
			                    ans="NO";
			                    break;
			               }
			               if(i<r-1 && pasture.get(i+1)[j]=='W'){
			                    ans="NO";
			                    break;
			               }
			               if(j>0 && pasture.get(i)[j-1]=='W'){
			                    ans="NO";
			                    break;
			               }
			               if(j<c-1 && pasture.get(i)[j+1]=='W'){
			                    ans="NO";
			                    break;
			               }
			               if(i>0 && pasture.get(i-1)[j]!='S'){
			                    pasture.get(i-1)[j]='D';
			               }
			               if(i<r-1 && pasture.get(i+1)[j]!='S'){
			                    pasture.get(i+1)[j]='D';
			               }
			               if(j>0 && pasture.get(i)[j-1]!='S'){
			                    pasture.get(i)[j-1]='D';
			               }
			               if(j<c-1 && pasture.get(i)[j+1]!='S' ){
			                    pasture.get(i)[j+1]='D';
			               }
			          }
			     }
			}
			
			out.println(ans);
			
			if(ans=="YES"){
     			for(int i=0;i<r;i++){
     			     out.println(pasture.get(i));
     			}
			}
			
			//ans1.append(ans).append(System.getProperty("line.separator"));
		}
		
		//out.println(ans1);
 		out.close();
 		
 	}

	//comparator to solve according to b in descending order
	static class Pair implements Comparable<Pair>{
		private long a;
		private long b;
		public Pair(long a, long b) {
			this.a = a;
			this.b = b;
		}
		public int compareTo(Pair other) {
			//return Long.compare(this.b, other.b );		//to sort in ascending order swap the arguments in Long.compare
			return Long.compare(other.b ,this.b); 	//to sort in descending order swap the arguments in Long.compare
		}
	}
	
	static void printArray(long[] a) {
		StringBuilder stringBuilder=new StringBuilder();
		for(long i: a)	stringBuilder.append(i).append(" ");
		out.println(stringBuilder);
	}
	
	public static void sort(long[] array){
		ArrayList<Long> copy = new ArrayList<>();
		for (long i : array)
			copy.add(i);
		Collections.sort(copy);
		for(int i = 0;i<array.length;i++)
			array[i] = copy.get(i);
	}
	
	public static void sortDes(long[] array){
		ArrayList<Long> copy = new ArrayList<>();
		for (long i : array)
			copy.add(i);
		Collections.sort(copy);
		int j=array.length-1;
		for(int i = 0;i<array.length;i++)
			array[j--] = copy.get(i);
	}
	
	
	static String[] readArrayString(int n){
		String[] array = new String[n];
		for(int j =0 ;j<n;j++)
			array[j] = in.next();
		return array;
	}
	
	
	static int[] readArrayInt(int n){
    	int[] array = new int[n];
    	for(int j = 0;j<n;j++)
    		array[j] = in.nextInt();
    	return array;
    }
	
	static int[] readArrayInt1(int n){
		int[] array = new int[n+1];
		for(int j = 1;j<=n;j++){
			array[j] = in.nextInt();
		}
		return array;
	}
	
	static long[] readArrayLong(int n){
		long[] array = new long[n];
		for(int j =0 ;j<n;j++)
			array[j] = in.nextLong();
		return array;
	}
	
	static double[] readArrayDouble(int n){
		double[] array = new double[n];
		for(int j =0 ;j<n;j++)
			array[j] = in.nextDouble();
		return array;
	}
	
	static int minIndex(int[] array){
		int minValue = Integer.MAX_VALUE;
		int minIndex = -1;
		for(int j = 0;j<array.length;j++){
			if (array[j] < minValue){
				minValue = array[j];
				minIndex = j;
			}
		}
		return minIndex;
	}
	
	static int minIndex(long[] array){
		long minValue = Long.MAX_VALUE;
		int minIndex = -1;
		for(int j = 0;j<array.length;j++){
			if (array[j] < minValue){
				minValue = array[j];
				minIndex = j;
			}
		}
		return minIndex;
	}
	
	static int minIndex(double[] array){
		double minValue = Double.MAX_VALUE;
		int minIndex = -1;
		for(int j = 0;j<array.length;j++){
			if (array[j] < minValue){
				minValue = array[j];
				minIndex = j;
			}
		}
		return minIndex;
	}
	
	static boolean isPrime(int n)
    {
        if (n <= 1)		return false;
        if (n <= 3)		return true;
        if (n % 2 == 0 || n % 3 == 0)	return false;
 
        for (int i = 5;i * i <= n; i = i + 6)
            if (n % i == 0 || n % (i + 2) == 0)		return false;
        return true;
    }
    
	static ArrayList<Integer> sieveOfEratosthenes(int n)
    {
        ArrayList<Integer> al = new ArrayList<>();
        boolean prime[] = new boolean[n + 1];
        for (int i = 0; i <= n; i++)
            prime[i] = true;
 
        for (int p = 2; p * p <= n; p++)
        {
            if (prime[p] == true)
            {
                for (int i = p * p; i <= n; i += p)
                    prime[i] = false;
            }
        }
        for (int i = 2; i <= n; i++)
        {
            if (prime[i] == true)
                al.add(i);
        }
        return al;
    }
	
	static long power(long x, long y){
		if (y == 0)
			return 1;
		if (y%2 == 1)
			return (x*power(x, y-1))%mod;
		return power((x*x)%mod, y/2)%mod;
	}
	static void verdict(boolean a){
        out.println(a ? "YES" : "NO");
    }
	
	static long gcd_bin(long x, long a)	{
        if (x == 0)		return a;
        if (a == 0)		return x;
        int k;
        for (k = 0; ((x | a) & 1) == 0; ++k){
            x >>= 1;
            a >>= 1;
        }
        while ((x & 1) == 0)	x >>= 1;
        do{
            while ((a & 1) == 0)	a >>= 1;
            if (x > a){
                long temp = x;
                x = a;
                a = temp;
            }
            a = (a - x);
        } while (a != 0);
        return x << k;
    }
	
    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;
        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } 
                catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }
        double nextDouble() {
            return Double.parseDouble(next());
        }
        String nextLine() {
            String str = "";
            try{
                str = br.readLine();
            } 
            catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
        
    }	
}