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.
import java.awt.Point;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.List;
import java.util.Properties;
import java.util.Stack;

/**
 * Works good for CF
 * @author cykeltillsalu
 */
public class Jumper {

	//some local config
	static boolean test = false;
	static String testDataFile = "testdata.txt";
	static String feedFile = "feed.txt";
	CompetitionType type = CompetitionType.CF;
	private static String ENDL = "\n";

	class State{
		int pos, wall, time;

		public State(int pos, int wall, int time) {
			super();
			this.pos = pos;
			this.wall = wall;
			this.time = time;
		}
		
	}
	
	// solution
	private void solve() throws Throwable {
		
		int n = iread(), k = iread();
		
		boolean[][] free = new boolean[2][n]; 
		int[][] min = new int[2][n];
		for (int i = 0; i < min.length; i++) {
			Arrays.fill(min[i], Integer.MAX_VALUE/2);		
		}
		min[0][0] = 0;
		
		String r = wread();
		for (int i = 0; i < n; i++) {
			free[0][i] = r.charAt(i) != 'X';
		}
		
		r = wread();
		for (int i = 0; i < n; i++) {
			free[1][i] = r.charAt(i) != 'X';
		}
		Stack<State> stack = new Stack<Jumper.State>();
		stack.push(new State(0, 0, 0));
		boolean win = false;
		out: while (stack.size() > 0) {
			State pop = stack.pop();
			
			int pos = pop.pos;
			int wall = pop.wall;
			int time = pop.time;
			
			if(time > pos){
				continue;
			}
			if(pos >= n -k){
				win = true;
				break out;
			}
			
			if(pos > 0){
				if(free[wall][pos-1] && min[wall][pos-1] > time + 1){
					stack.push(new State(pos -1, wall, time + 1));
					min[wall][pos-1] = Math.min(time + 1, min[wall][pos-1]);
				}
			}	
			
			if(pos < n -1 ){
				if(free[wall][pos+1] && min[wall][pos+1] > time + 1){
					stack.push(new State(pos +1, wall, time + 1));
					min[wall][pos+1] = Math.min(time + 1, min[wall][pos+1]);
				}
			}
			
			int nextWall = (wall + 1) % 2;
			if(free[nextWall][pos + k] && min[nextWall][pos + k] > time + 1){
				stack.push(new State(pos +k, nextWall, time + 1));
				min[nextWall][pos+k] = Math.min(time + 1, min[nextWall][pos+k]);
			}
		}
		
		String ans = win ? "YES" : "NO";
		
		System.out.println(ans);
	}
	
	public int iread() throws Exception {
		return Integer.parseInt(wread());
	}

	public double dread() throws Exception {
		return Double.parseDouble(wread());
	}

	public long lread() throws Exception {
		return Long.parseLong(wread());
	}

	public String wread() throws IOException {
		StringBuilder b = new StringBuilder();
		int c;
		c = in.read();
		while (c >= 0 && c <= ' ')
			c = in.read();
		if (c < 0)
			return "";
		while (c > ' ') {
			b.append((char) c);
			c = in.read();
		}
		return b.toString();
	}

	public static void main(String[] args) throws Throwable {
		
		if(test){ //run all cases from testfile:
			BufferedReader testdataReader = new BufferedReader(new FileReader(testDataFile));
			String readLine = testdataReader.readLine();
			int casenr = 0;
			out: while (true) {
				BufferedWriter w = new BufferedWriter(new FileWriter(feedFile));
				if(!readLine.equalsIgnoreCase("input")){
					break;
				}
				while (true) {
					readLine = testdataReader.readLine();
					if(readLine.equalsIgnoreCase("output")){
						break;
					}
					w.write(readLine + "\n");
				}
				w.close();
				System.out.println("Answer on case "+(++casenr)+": ");
				
				new Jumper().solve();
				System.out.println("Expected answer: ");
				
				
				while (true) {
					readLine = testdataReader.readLine();
					
					if(readLine == null){
						break out;
					}
					if(readLine.equalsIgnoreCase("input")){
						break;
					}
					System.out.println(readLine);
				}
				System.out.println("----------------");
			}
			testdataReader.close();
		} else { // run on server
			new Jumper().solve();
		}
		out.close();
	}

	public Jumper() throws Throwable {
		if (test) {
			in = new BufferedReader(new FileReader(new File(feedFile)));
		}
	}

	InputStreamReader inp = new InputStreamReader(System.in);
	BufferedReader in = new BufferedReader(inp);
	static BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
	
	enum CompetitionType {CF, OTHER};
}