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.File;import java.io.FileInputStream;import java.io.FileNotFoundException;
import java.io.IOException;import java.io.PrintStream;import java.io.PrintWriter;
import java.security.AccessControlException;import java.util.Arrays;import java.util.Collection;
import java.util.Comparator;import java.util.List;import java.util.Map;import java.util.Objects;
import java.util.Scanner;import java.util.TreeMap;import java.util.function.Function;
import java.util.stream.Collectors;import java.util.stream.IntStream;import java.util.stream.LongStream;
import java.util.stream.Stream;public class _p000948A {static public void main(final String[] args) 
throws IOException{p000948A._main(args);}
static private class p000948A extends Solver{public p000948A(){nameIn="in/900/p000948A.in"
;singleTest=true;}@Override public void solve()throws IOException{int R=sc.nextInt
();int C=sc.nextInt();if(sc.hasNextLine()){sc.nextLine();}int[][]field=new int[R
][C];for(int _is=0;_is<R;_is++){field[_is]=sc.nextLine().trim().chars().toArray(
);}boolean res=true;l:for(int i=0;i<R;i++){for(int j=0;j<C;j++){if(field[i][j]==
'S'){if(i>0){if(field[i-1][j]=='.'){field[i-1][j]='D';}else if(field[i-1][j]=='W'
){res=false;break l;}}if(i<R-1){if(field[i+1][j]=='.'){field[i+1][j]='D';}else if
(field[i+1][j]=='W'){res=false;break l;}}if(j>0){if(field[i][j-1]=='.'){field[i]
[j-1]='D';}else if(field[i][j-1]=='W'){res=false;break l;}}if(j<C-1){if(field[i]
[j+1]=='.'){field[i][j+1]='D';}else if(field[i][j+1]=='W'){res=false;break l;}}}
}}if(!res){pw.println("No");}else{pw.println("Yes");Arrays.stream(field).forEach
(r->pw.println(join(Arrays.stream(r).mapToObj(v->String.valueOf((char)v))).replace
(" ","")));}}static public void _main(String[]args)throws IOException{new p000948A
().run();}}static private class Pair<K,V>{private K k;private V v;public Pair(final
 K t,final V u){this.k=t;this.v=u;}public K getKey(){return k;}public V getValue
(){return v;}}static private abstract class Solver{protected String nameIn=null;
protected String nameOut=null;protected boolean singleTest=false;protected boolean
 preprocessDebug=false;protected boolean doNotPreprocess=false;protected PrintStream
 debugPrintStream=null;protected Scanner sc=null;protected PrintWriter pw=null;final
 static String SPACE=" ";final static String SPACES="\\s+";private void process(
)throws IOException{if(!singleTest){int t=lineToIntArray()[0];while(t-->0){solve
();}}else{solve();}}abstract protected void solve()throws IOException;protected 
String[]lineToArray()throws IOException{return sc.nextLine().trim().split(SPACES
);}protected int[]lineToIntArray()throws IOException{return Arrays.stream(lineToArray
()).mapToInt(Integer::valueOf).toArray();}protected long[]lineToLongArray()throws
 IOException{return Arrays.stream(lineToArray()).mapToLong(Long::valueOf).toArray
();}protected void run()throws IOException{boolean done=false;try{if(nameIn!=null
 && new File(nameIn).exists()){try(FileInputStream fis=new FileInputStream(nameIn
);PrintWriter pw0=select_output();){done=true;sc=new Scanner(fis);pw=pw0;process
();}}}catch(IOException ex){}catch(AccessControlException ex){}if(!done){try(PrintWriter
 pw0=select_output();){sc=new Scanner(System.in);pw=pw0;process();}}}private PrintWriter
 select_output()throws FileNotFoundException{if(nameOut!=null){return new PrintWriter
(nameOut);}return new PrintWriter(System.out);}public static Map<Integer,List<Integer
>>mapi(final int[]a){return IntStream.range(0,a.length).collect(()->new TreeMap<
Integer,List<Integer>>(),(res,i)->{if(!res.containsKey(a[i])){res.put(a[i],Stream
.of(i).collect(Collectors.toList()));}else{res.get(a[i]).add(i);}},Map::putAll);
}public static Map<Long,List<Integer>>mapi(final long[]a){return IntStream.range
(0,a.length).collect(()->new TreeMap<Long,List<Integer>>(),(res,i)->{if(!res.containsKey
(a[i])){res.put(a[i],Stream.of(i).collect(Collectors.toList()));}else{res.get(a[
i]).add(i);}},Map::putAll);}public static<T>Map<T,List<Integer>>mapi(final T[]a)
{return IntStream.range(0,a.length).collect(()->new TreeMap<T,List<Integer>>(),(
res,i)->{if(!res.containsKey(a[i])){res.put(a[i],Stream.of(i).collect(Collectors
.toList()));}else{res.get(a[i]).add(i);}},Map::putAll);}public static<T>Map<T,List
<Integer>>mapi(final T[]a,Comparator<T>cmp){return IntStream.range(0,a.length).collect
(()->new TreeMap<T,List<Integer>>(cmp),(res,i)->{if(!res.containsKey(a[i])){res.
put(a[i],Stream.of(i).collect(Collectors.toList()));}else{res.get(a[i]).add(i);}
},Map::putAll);}public static Map<Integer,List<Integer>>mapi(final IntStream a){
int[]i=new int[]{0};return a.collect(()->new TreeMap<Integer,List<Integer>>(),(res
,v)->{if(!res.containsKey(v)){res.put(v,Stream.of(i[0]).collect(Collectors.toList
()));}else{res.get(v).add(i[0]);}i[0]++;},Map::putAll);}public static Map<Long,List
<Integer>>mapi(final LongStream a){int[]i=new int[]{0};return a.collect(()->new 
TreeMap<Long,List<Integer>>(),(res,v)->{if(!res.containsKey(v)){res.put(v,Stream
.of(i[0]).collect(Collectors.toList()));}else{res.get(v).add(i[0]);}i[0]++;},Map
::putAll);}public static<T>Map<T,List<Integer>>mapi(final Stream<T>a,Comparator<
T>cmp){int[]i=new int[]{0};return a.collect(()->new TreeMap<T,List<Integer>>(cmp
),(res,v)->{if(!res.containsKey(v)){res.put(v,Stream.of(i[0]).collect(Collectors
.toList()));}else{res.get(v).add(i[0]);}},Map::putAll);}public static<T>Map<T,List
<Integer>>mapi(final Stream<T>a){int[]i=new int[]{0};return a.collect(()->new TreeMap
<T,List<Integer>>(),(res,v)->{if(!res.containsKey(v)){res.put(v,Stream.of(i[0]).
collect(Collectors.toList()));}else{res.get(v).add(i[0]);}},Map::putAll);}public
 static List<int[]>listi(final int[]a){return IntStream.range(0,a.length).mapToObj
(i->new int[]{a[i],i}).collect(Collectors.toList());}public static List<long[]>listi
(final long[]a){return IntStream.range(0,a.length).mapToObj(i->new long[]{a[i],i
}).collect(Collectors.toList());}public static<T>List<Pair<T,Integer>>listi(final
 T[]a){return IntStream.range(0,a.length).mapToObj(i->new Pair<T,Integer>(a[i],i
)).collect(Collectors.toList());}public static List<int[]>listi(final IntStream 
a){int[]i=new int[]{0};return a.mapToObj(v->new int[]{v,i[0]++}).collect(Collectors
.toList());}public static List<long[]>listi(final LongStream a){int[]i=new int[]
{0};return a.mapToObj(v->new long[]{v,i[0]++}).collect(Collectors.toList());}public
 static<T>List<Pair<T,Integer>>listi(final Stream<T>a){int[]i=new int[]{0};return
 a.map(v->new Pair<T,Integer>(v,i[0]++)).collect(Collectors.toList());}public static
 String join(final int[]a){return Arrays.stream(a).mapToObj(Integer::toString).collect
(Collectors.joining(SPACE));}public static String join(final long[]a){return Arrays
.stream(a).mapToObj(Long::toString).collect(Collectors.joining(SPACE));}public static
<T>String join(final T[]a){return Arrays.stream(a).map(v->Objects.toString(v)).collect
(Collectors.joining(SPACE));}public static<T>String join(final T[]a,final Function
<T,String>toString){return Arrays.stream(a).map(v->toString.apply(v)).collect(Collectors
.joining(SPACE));}public static<T>String join(final Collection<T>a){return a.stream
().map(v->Objects.toString(v)).collect(Collectors.joining(SPACE));}public static
<T>String join(final Collection<T>a,final Function<T,String>toString){return a.stream
().map(v->toString.apply(v)).collect(Collectors.joining(SPACE));}public static<T
>String join(final Stream<T>a){return a.map(v->Objects.toString(v)).collect(Collectors
.joining(SPACE));}public static<T>String join(final Stream<T>a,final Function<T,
String>toString){return a.map(v->toString.apply(v)).collect(Collectors.joining(SPACE
));}public static<T>String join(final IntStream a){return a.mapToObj(Integer::toString
).collect(Collectors.joining(SPACE));}public static<T>String join(final LongStream
 a){return a.mapToObj(Long::toString).collect(Collectors.joining(SPACE));}public
 static List<Integer>list(final int[]a){return Arrays.stream(a).mapToObj(Integer
::valueOf).collect(Collectors.toList());}public static List<Integer>list(final IntStream
 a){return a.mapToObj(Integer::valueOf).collect(Collectors.toList());}public static
 List<Long>list(final long[]a){return Arrays.stream(a).mapToObj(Long::valueOf).collect
(Collectors.toList());}public static List<Long>list(final LongStream a){return a
.mapToObj(Long::valueOf).collect(Collectors.toList());}public static<T>List<T>list
(final Stream<T>a){return a.collect(Collectors.toList());}public static<T>List<T
>list(final T[]a){return Arrays.stream(a).collect(Collectors.toList());}}}