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 org.omg.PortableInterceptor.SYSTEM_EXCEPTION;

import java.io.*;
import java.math.*;
import java.util.*;


// author @mdazmat9
public class codeforces{
    static int ROW=-1,COL=-1;

    public static void main(String[] args) throws IOException {

        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int test = 1;
        for (int ind = 0; ind < test; ind++) {
            int n = sc.nextInt();
            int m=sc.nextInt();
            char[][] c=new char[n][m];
            for(int i=0;i<n;i++){
                String s=sc.next();
                for(int j=0;j<m;j++){
                    c[i][j]=s.charAt(j);
                }
            }
            boolean bool=false;
            for(int i=0;i<n;i++){
                for(int j=0;j<m;j++){
                    if(c[i][j]=='W'){
                        boolean b1=false,b2=false,b3=false,b4=false;
                        if(i+1<n){
                            if(c[i+1][j]=='S')
                                b1=true;
                        }
                        if(i-1>=0){
                            if(c[i-1][j]=='S')
                                b2=true;
                        }
                        if(j+1<m){
                            if(c[i][j+1]=='S')
                                b3=true;
                        }
                        if(j-1>=0){
                            if(c[i][j-1]=='S')
                                b4=true;
                        }

                        if(b1|| b2||b3||b4){
                            bool=true;
                            break;
                        }
                    }
                }
                if(bool)
                    break;
            }
            if(bool)
                out.println("No");
            else{
                out.println("Yes");
                for(int i=0;i<n;i++){
                    for(int j=0;j<m;j++){
                        if(c[i][j]=='.')
                            out.print("D");
                        else
                       out.print(c[i][j]);
                    }
                    out.println();
                }
            }
        }
        out.flush();
    }
   static boolean isSafe(int M[][], int row, int col,
                   boolean visited[][])
    {
        // row number is in range, column number is in range
        // and value is 1 and not yet visited
        return (row >= 0) && (row < ROW) &&
                (col >= 0) && (col < COL) &&
                (M[row][col]==0 && !visited[row][col]);
    }

    // A utility function to do DFS for a 2D boolean matrix.
    // It only considers the 8 neighbors as adjacent vertices
    static ArrayList<String> DFS(int M[][], int row, int col, boolean visited[][],ArrayList<String> list)
    {
        // These arrays are used to get row and column numbers
        // of 8 neighbors of a given cell
        int rowNbr[] = new int[] { -1,  0, 0,   1,};
        int colNbr[] = new int[] {  0,  -1, 1, 0, };

        // Mark this cell as visited
        visited[row][col] = true;
        list.add(row+"x"+col);
        // Recur for all connected neighbours
        for (int k = 0; k < 4; ++k)
            if (isSafe(M, row + rowNbr[k], col + colNbr[k], visited) )
                DFS(M, row + rowNbr[k], col + colNbr[k], visited,list);
        return list;
    }

    static long fast_pow(long a, long b) {
        if(b == 0)
            return 1L;

        long val = fast_pow(a, b / 2);

        if(b % 2 == 0)
            return val * val % mod;
        else
            return val * val % mod * a % mod;
    }
    static long mod = (long)1e9 + 7;
    static   void shuffle(int[] a) {
        int n = a.length;
        for(int i = 0; i < n; i++) {
            int r = i + (int) (Math.random() * (n - i));
            int tmp = a[i];
            a[i] = a[r];
            a[r] = tmp;
        }
    }
    static long gcd(long a , long b)
    {
        if(b == 0)
            return a;
        return gcd(b , a % b);
    }

}
class Scanner {
    public BufferedReader reader;
    public StringTokenizer st;

    public Scanner(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        st = null;
    }

    public String next() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = reader.readLine();
                if (line == null) return null;
                st = new StringTokenizer(line);
            } catch (Exception e) {
                throw (new RuntimeException());
            }
        }
        return st.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public long nextLong() {
        return Long.parseLong(next());
    }

    public double nextDouble() {
        return Double.parseDouble(next());
    }
}

class OutputWriter {
    BufferedWriter writer;

    public OutputWriter(OutputStream stream) {
        writer = new BufferedWriter(new OutputStreamWriter(stream));
    }

    public void print(int i) throws IOException {
        writer.write(i);
    }

    public void print(String s) throws IOException {
        writer.write(s);
    }

    public void print(char[] c) throws IOException {
        writer.write(c);
    }

    public void close() throws IOException {
        writer.close();
    }

}
class Pair {
    int x;
    int y;

    // Constructor
    public Pair(int x, int y)
    {
        this.x = x;
        this.y = y;
    }
}
class Compare {

    static void compare(Pair arr[], int n)
    {
        // Comparator to sort the pair according to second element
        Arrays.sort(arr, new Comparator<Pair>() {
            @Override public int compare(Pair p1, Pair p2)
            {
                return p1.x - p2.x;
            }
        });
    }
}

class Graph {
    // A user define class to represent a graph.
    // A graph is an array of adjacency lists.
    // Size of array will be V (number of vertices
    // in graph)
    int V;
    ArrayList<Integer>[] adjListArray;

    // constructor
    Graph(int V) {
        this.V = V;
        // define the size of array as
        // number of vertices
        adjListArray = new ArrayList[V];

        // Create a new list for each vertex
        // such that adjacent nodes can be stored

        for (int i = 0; i < V; i++) {
            adjListArray[i] = new ArrayList<>();
        }
    }

    // Adds an edge to an undirected graph
    void addEdge(int src, int dest) {

        // Add an edge from src to dest.
        //src--;dest--; //do this for 1 based indexing

        //
        adjListArray[src].add(dest);

        // Since graph is undirected, add an edge from dest
        // to src also
        adjListArray[dest].add(src);
    }


    ArrayList<Integer> DFSUtil(int u, boolean visited[], int parent,ArrayList<Integer> list)
    {
        // Mark the current node as visited
        visited[u] = true;

        for (int i = 0; i < adjListArray[u].size(); i++) {
            int n = adjListArray[u].get(i);
            list.add(n);

            if (!visited[i]) {
                DFSUtil(n, visited, u,list);
            }
        }
        return list;

    }


    // The function to do DFS traversal. It uses recursive DFSUtil()
    void DFS(int r,int c) {
        // Mark all the vertices as not visited(set as
        // false by default in java)
        boolean visited[] = new boolean[V];
       ArrayList<Integer> list=new ArrayList<>();
        // Call the recursive helper function to print DFS traversal
        boolean bool=true;

    }

    }