Vasya plays a computer game with ninjas. At this stage Vasya's ninja should get out of a deep canyon.

The canyon consists of two vertical parallel walls, their height is n meters. Let's imagine that we split these walls into 1 meter-long areas and number them with positive integers from 1 to n from bottom to top. Some areas are safe and the ninja can climb them. Others are spiky and ninja can't be there. Let's call such areas dangerous.

Initially the ninja is on the lower area of the left wall. He can use each second to perform one of the following actions: 

  * climb one area up; 
  * climb one area down; 
  * jump to the opposite wall. That gets the ninja to the area that is exactly k meters higher than the area he jumped from. More formally, if before the jump the ninja is located at area x of one wall, then after the jump he is located at area x + k of the other wall. 



If at some point of time the ninja tries to get to an area with a number larger than n, then we can assume that the ninja got out of the canyon.

The canyon gets flooded and each second the water level raises one meter. Initially the water level is at the lower border of the first area. Ninja cannot be on the area covered by water. We can assume that the ninja and the water "move in turns" — first the ninja performs some action, then the water raises for one meter, then the ninja performs one more action and so on.

The level is considered completed if the ninja manages to get out of the canyon.

After several failed attempts Vasya started to doubt whether it is possible to complete the level at all. Help him answer the question.

Input

The first line contains two integers n and k (1 ≤ n, k ≤ 105) — the height of the canyon and the height of ninja's jump, correspondingly.

The second line contains the description of the left wall — a string with the length of n characters. The i-th character represents the state of the i-th wall area: character "X" represents a dangerous area and character "-" represents a safe area.

The third line describes the right wall in the same format.

It is guaranteed that the first area of the left wall is not dangerous.

Output

Print "YES" (without the quotes) if the ninja can get out from the canyon, otherwise, print "NO" (without the quotes).

Examples

Input

7 3
---X--X
-X--XX-


Output

YES


Input

6 2
--X-X-
X--XX-


Output

NO

Note

In the first sample the ninja should first jump to the right wall, then go one meter down along the right wall, then jump to the left wall. The next jump can get the ninja from the canyon. 

In the second sample there's no way the ninja can get out of the canyon.
2 1
-X
X-
 25 3
-XXXXX-XXXXX-XXXXX-X-XXXX
XXX-XXXXX-XXXXX-X-----X--
 6 2
--X--X
XX-X-X
 12 3
--XX--XX-XXX
----X---XXX-
 101 1
----------------------------------------------------------------------------------------------------X
----------------------------------------------------------------------------------------------------X
 5 1
----X
----X
 10 8
-XXXXXXXXX
XXXXXXXXX-
 5 4
-X---
----X
 2 1
-X
-X
 1 20
-
-
 50 4
-X-X-X--X--X--X-XX-----XX--X--------------XXX-X-X-
--XX---XXXXXXX----XX--X--XXX--XXXX-XX--X--X--X----
 5 2
-----
XXXXX
 5 2
---XX
---X-
 1 100000
-
-
 1 1
-
X
 10 1
-X-X-X-X-X
X-X-X-X-X-
 12 2
-X-X-X-X-X-X
X---XXX--X-X
 100 10
-X------XXX--XXX-XXXXXX---XXX---X-XX--XXX----------XX-X-XXXX-X-X-XX-X-X--XXXXX---X--X--XXX-X--XXXXXX
---X-XXXXXXX--X-XXX--X-XX--XX----XX-X----X-X-XX-X--X-XXXXXXX-XX-X---X--XX-X-XX--XXXXXXX-X--XX--X-XXX
 12 4
----X---X--X
-----X-----X
 13 2
---X---X--X-X
--X---X-X--X-

YES
 YES
 YES
 NO
 NO
 NO
 NO
 NO
 NO
 YES
 YES
 YES
 YES
 YES
 YES
 YES
 NO
 NO
 YES
 YES

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import java.util.Arrays;
import java.util.Comparator;
import java.util.PriorityQueue;

/**
 * @author Ivan Pryvalov (ivan.pryvalov@gmail.com)
 */
public class Codeforces12_Div2_D implements Runnable{
	
	class Position{
		int side;//0 or 1
		int height;//0..n-1
		int time;//0 or more
		public Position(int side, int height, int time) {
			super();
			this.side = side;
			this.height = height;
			this.time = time;
		}
		//requirement: height>=time
		
		public boolean isValid() {
			return height>=0 && height>=time;
		}
	}

	int N;
	boolean[][] map;
	boolean reached = false;
	
	private void solve() throws IOException {
		int n = scanner.nextInt();
		int k = scanner.nextInt(); //10^5

		N = n;
		String s = scanner.nextLine();
		//true = OK
		boolean[] left = new boolean[n];
		for (int i = 0; i < n; i++) {
			left[i] = s.charAt(i)=='-';			
		}
		s = scanner.nextLine();
		boolean[] right = new boolean[n];
		for (int i = 0; i < n; i++) {
			right[i] = s.charAt(i)=='-';			
		}
		
		map = new boolean[][]{left, right};
		
		int[] c0 = new int[n];
		int[] c1 = new int[n];
		int[][] c = {c0, c1};
		for (int[] ar: c) {
			Arrays.fill(ar, Integer.MAX_VALUE);			
		}
		
		Comparator<Position> comparator = new Comparator<Position>() {
			@Override
			public int compare(Position o1, Position o2) {
				return o1.time - o2.time;
			}
		};
		PriorityQueue<Position> queue = new PriorityQueue<Position>(10, comparator);
		queue.add(new Position(0,0,0));
		
		c[0][0] = 0;
		while((!queue.isEmpty()) && !reached){
			Position curPos = queue.remove();
			if (c[curPos.side][curPos.height] == curPos.time){
				Position newPosUp = new Position(curPos.side, curPos.height+1, curPos.time+1);
				update(newPosUp, c, queue);
				
				Position newPosDown = new Position(curPos.side, curPos.height-1, curPos.time+1);
				update(newPosDown, c, queue);
				
				Position newPosJump = new Position(1-curPos.side, curPos.height+k, curPos.time+1);
				update(newPosJump, c, queue);
			}
		}
		
		if (reached){
			out.println("YES");
		}else{
			out.println("NO");
		}
	}

	private void update(Position newPos, int[][] c, PriorityQueue<Position> queue) {
		if (!newPos.isValid())
			return;
		if (newPos.height >= N){
			reached = true;
			return;
		}
		if (map[newPos.side][newPos.height] && newPos.time < c[newPos.side][newPos.height]){
			c[newPos.side][newPos.height] = newPos.time;
			queue.add(newPos);
		}
	}

	/////////////////////////////////////////////////
	final int BUF_SIZE = 1024 * 1024 * 8;//important to read long-string tokens properly
	final int INPUT_BUFFER_SIZE = 1024 * 1024 * 8 ;
	final int BUF_SIZE_INPUT = 1024;
	
	final int BUF_SIZE_OUT = 1024;
	
	boolean inputFromFile = false;
	String filenamePrefix = "A-small-attempt0";
	String inSuffix = ".in";
	String outSuffix = ".out";
	
	//InputStream bis;
	//OutputStream bos;
	PrintStream out;
	ByteScanner scanner;
	ByteWriter writer;
	
	@Override
	public void run() {
		try{
			InputStream bis = null;
			OutputStream bos = null;
			//PrintStream out = null;
			if (inputFromFile){
				File baseFile = new File(getClass().getResource("/").getFile());
				bis = new BufferedInputStream(
						new FileInputStream(new File(
								baseFile, filenamePrefix+inSuffix)),
								INPUT_BUFFER_SIZE);
				bos = new BufferedOutputStream(
						new FileOutputStream(
								new File(baseFile, filenamePrefix+outSuffix)));
				out = new PrintStream(bos);
			}else{
				bis = new BufferedInputStream(System.in, INPUT_BUFFER_SIZE);
				bos = new BufferedOutputStream(System.out);
				out = new PrintStream(bos);
			}
			scanner = new ByteScanner(bis, BUF_SIZE_INPUT, BUF_SIZE);
			writer = new ByteWriter(bos, BUF_SIZE_OUT);
			
			solve();
			out.flush();
		}catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}
	
	public interface Constants{
		final static byte ZERO = '0';//48 or 0x30
		final static byte NINE = '9';
		final static byte SPACEBAR = ' '; //32 or 0x20
		final static byte MINUS = '-'; //45 or 0x2d	
		
		final static char FLOAT_POINT = '.';
	}
	
	public static class EofException extends IOException{
	}
	
	public static class ByteWriter implements Constants {
		
		int bufSize = 1024;
		byte[] byteBuf = new byte[bufSize];
		OutputStream os;
		
		public ByteWriter(OutputStream os, int bufSize){
			this.os = os;
			this.bufSize = bufSize;
		}
		
		public void writeInt(int num) throws IOException{
	         int byteWriteOffset = byteBuf.length;
	         if (num==0){
	        	 byteBuf[--byteWriteOffset] = ZERO;
	         }else{
	        	 int numAbs = Math.abs(num);
	        	 while (numAbs>0){
	        		 byteBuf[--byteWriteOffset] = (byte)((numAbs % 10) + ZERO);
	        		 numAbs /= 10;
	        	 }
	        	 if (num<0)
	        		 byteBuf[--byteWriteOffset] = MINUS;
	         }
	         os.write(byteBuf, byteWriteOffset, byteBuf.length - byteWriteOffset);
		}
		
		/**
		 * Please ensure ar.length <= byteBuf.length!
		 * 
		 * @param ar
		 * @throws IOException
		 */
		public void writeByteAr(byte[] ar) throws IOException{
			for (int i = 0; i < ar.length; i++) {
				byteBuf[i] = ar[i];
			}
			os.write(byteBuf,0,ar.length);
		}
		
		public void writeSpaceBar() throws IOException{
			byteBuf[0] = SPACEBAR;
			os.write(byteBuf,0,1);
		}
		
	}
	
	public static class ByteScanner implements Constants{
		
		InputStream is;
		
		public ByteScanner(InputStream is, int bufSizeInput, int bufSize){
			this.is = is;
			this.bufSizeInput = bufSizeInput;
			this.bufSize = bufSize;
			
			byteBufInput = new byte[this.bufSizeInput];
			byteBuf = new byte[this.bufSize];
		}
		
		public ByteScanner(byte[] data){
			byteBufInput = data;
			bufSizeInput = data.length;
			bufSize = data.length;
			byteBuf = new byte[bufSize];
			byteRead = data.length;
			bytePos = 0;
		}
		
		private int bufSizeInput;
		private int bufSize;
		
		byte[] byteBufInput;
		byte by=-1;
		int byteRead=-1;
		int bytePos=-1;

		byte[] byteBuf;
		int totalBytes;
		
		boolean eofMet = false;
		
		private byte nextByte() throws IOException{
			
			if (bytePos<0 || bytePos>=byteRead){
				byteRead = is==null? -1: is.read(byteBufInput);
				bytePos=0;
				if (byteRead<0){
					byteBufInput[bytePos]=-1;//!!!
					if (eofMet)
						throw new EofException();
					eofMet = true;
				}
			}
			return byteBufInput[bytePos++];
		}
		
		/**
		 * Returns next meaningful character as a byte.<br>
		 * 
		 * @return
		 * @throws IOException
		 */
		public byte nextChar() throws IOException{
			while ((by=nextByte())<=0x20);
			return by;
		}
		
		/**
		 * Returns next meaningful character OR space as a byte.<br>
		 * 
		 * @return
		 * @throws IOException
		 */
		public byte nextCharOrSpacebar() throws IOException{
			while ((by=nextByte())<0x20);
			return by;
		}
		
	    /**
	     * Reads line.
	     * 
	     * @return
	     * @throws IOException
	     */
	    public String nextLine() throws IOException {
            readToken((byte)0x20);
            return new String(byteBuf,0,totalBytes);
	    }
	    
	    public byte[] nextLineAsArray() throws IOException {
            readToken((byte)0x20);
            byte[] out = new byte[totalBytes];
            System.arraycopy(byteBuf, 0, out, 0, totalBytes);
            return out;
	    }
	    
		
	    /**
	     * Reads token. Spacebar is separator char.
	     * 
	     * @return
	     * @throws IOException
	     */
	    public String nextToken() throws IOException {
            readToken((byte)0x21);
            return new String(byteBuf,0,totalBytes);
	    }
	    
	    /**
	     * Spacebar is included as separator char
	     * 
	     * @throws IOException
	     */
	    private void readToken() throws IOException {	    	
            readToken((byte)0x21);
	    }
	    
	    private void readToken(byte acceptFrom) throws IOException {
            totalBytes = 0;
            while ((by=nextByte())<acceptFrom);
            byteBuf[totalBytes++] = by;
            while ((by=nextByte())>=acceptFrom){
                byteBuf[totalBytes++] = by;
            }
	    }
		
	    public int nextInt() throws IOException{
			readToken();
			int num=0, i=0;
			boolean sign=false;
			if (byteBuf[i]==MINUS){
				sign = true;
				i++;
			}
			for (; i<totalBytes; i++){
				num*=10;
				num+=byteBuf[i]-ZERO;
			}
			return sign?-num:num;
		}
		
		public long nextLong() throws IOException{
			readToken();
			long num=0;
			int i=0;
			boolean sign=false;
			if (byteBuf[i]==MINUS){
				sign = true;
				i++;
			}
			for (; i<totalBytes; i++){
				num*=10;
				num+=byteBuf[i]-ZERO;
			}
			return sign?-num:num;
		}
		
		/*
		//TODO test Unix/Windows formats
		public void toNextLine() throws IOException{
			while ((ch=nextChar())!='\n');
		}
		*/
		
		public double nextDouble() throws IOException{
			readToken();
			char[] token = new char[totalBytes];
			for (int i = 0; i < totalBytes; i++) {
				token[i] = (char)byteBuf[i];
			}
			return Double.parseDouble(new String(token));
		}
	    
	}
	
	public static void main(String[] args) {
		new Codeforces12_Div2_D().run();
	}
	
}
