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.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.InputMismatchException;
import java.util.LinkedList;
import java.util.Queue;

public class Solution 
{
	static InputReader in = new InputReader(System.in);
	static int mod = (int)1e9 + 7;
	static int MAXN = 100005;
	static long[] fact = new long[MAXN];
	static long[] inv = new long[MAXN];
	
    public static void main(String args[]) {
        new Thread(null, new Runnable() {
            public void run() {
                try{
                    solve();
                }
                catch(Exception e){
                    e.printStackTrace();
                }
            }
        }, "1", 1 << 26).start();
    }
    
    public static void solve(){
    	int n = in.ni();
    	int k = in.ni();
    	Queue<int[]> q = new LinkedList<>();
    	boolean[][] visited = new boolean[n + k + 5][2];
    	//boolean[][] danger = new boolean[n + 1][2];
    	String s = in.readString();
    	for(int i = 0; i < n; i++) {
    		if(s.charAt(i) == 'X') visited[i + 1][0] = true;
    	}
    	
    	s = in.readString();
    	for(int i = 0; i < n; i++) {
    		if(s.charAt(i) == 'X') visited[i + 1][1] = true;
    	}
    	
    	q.add(new int[] {1, 0});
    	visited[1][0] = true;
    	int water = 0;
    	while(q.size() != 0) {
    		int size = q.size();
    		//for(int[] i: q) System.out.print("("+i[0]+", "+i[1]+") "); pn("");
    		while(size-- > 0) {
    			int[] element = q.poll();
    			int col = element[1];
    			int row = element[0];
    			if(row >= n) {
    				pn("YES");
    				return;
    			}
    			if(!visited[row + 1][col]) {
    				//pn("In");
        			q.add(new int[] {row + 1, col});
        			visited[row + 1][col] = true;
    			}
    			if(row > water + 2 && !visited[row - 1][col]) {
    				//pn("In");
        			q.add(new int[] {row - 1, col});
        			visited[row - 1][col] = true;
    			}
    			int changeCol = 1 - col;
    			//pn(changeCol);
    			if(!visited[row + k][changeCol]) {
    				//pn("In");
        			q.add(new int[] {row + k, changeCol});
        			visited[row + k][changeCol] = true;
    			}
    		}
    		water++;
    	}
    	pn("NO");
    }
        
   
	/*TEMPLATE*/
    
    //MATHS
    static int max(Integer... ar) {
    	int max = Integer.MIN_VALUE;
    	for(int i: ar) {
    		max = Math.max(max, i);
    	}
    	return max;
    }
    
    static long max(Long... ar) {
    	long max = Integer.MIN_VALUE;
    	for(long i: ar) {
    		max = Math.max(max, i);
    	}
    	return max;
    }
  
    static int gcd(int a, int b) {
    	return (b==0)?a:gcd(b,a%b);
    }
    
    static long binPow(long x, long y) {
        long ans = 1L;
        while(y > 0) {
            if(y % 2 == 1)
                ans = mul(ans, x);
            x = mul(x, x);
            y /= 2;
        }
        return ans;
    }
    
    static long add(long x, long y) {
    	x += y;
    	return mod(x, mod);
    }
    
    static long mul(long x, long y) {
    	return mod(x * y, mod);
    }
    
    static long divide(long x, long y) {
        return mul(x, binPow(y, mod - 2));
    }

    static long mod(long x, long p) {
        x %= p;
        if (x < 0)
            x += p;
        return x;
    }
        
    public static int[] spf(int maxn) {
    	int[] spf=new int[maxn+1];
    	spf[0]=spf[1]=1;
    	for(int i=2;i<=maxn;i++) {
    		if(i%2==0) spf[i]=2;
    		else 
    			spf[i]=i;
    	}
    	for(int i=3;i*i<=maxn;i++) {
    		if(spf[i]==i){
    			for (int j=i*i; j<=maxn; j+=i) 
                    if (spf[j]==j) 
                        spf[j] = i;
    		}
    	}
    	return spf;
    }
    
    static void nCrInit() {
    	fact[0] = 1;
    	for(int i = 1; i < MAXN; i++) fact[i] = mul(fact[i - 1], 1L * i);
    	inv[MAXN - 1] = binPow(fact[MAXN - 1], mod - 2); 
    	for(int i = MAXN - 2; i >= 0; i--) inv[i] = mul(inv[i + 1], 1L * (i + 1));
     }
    
    static long nCr(int n, int r) {
    	if(r > n || n < 0 || r < 0) return 0;
    	return fact[n] * inv[r] % mod * inv[n - r] % mod;
    }
    
    //ARRAYS
    public static int[] intArray(int n) {
    	int ar[]=new int[n];
    	for(int i=0;i<n;i++)
    		ar[i]=in.nextInt();
    	return ar;
    }
    
    public static void swap(int i, int j, int ar[]) {
    	int c=ar[i];ar[i]=ar[j];ar[j]=c;
    }
    
    public static void reverse(int ar[]) {
    	int l=0, r=ar.length-1;
    	while(l<r) {
    		int temp=ar[l]; ar[l]=ar[r]; ar[r]=temp;
    		l++; r--;
    	}
    }
    
    static int max(int[] ar) {
    	int max = Integer.MIN_VALUE;
    	for(int i: ar) {
    		max = Math.max(max, i);
    	}
    	return max;
    }
    
    static long max(long[] ar) {
    	long max = Integer.MIN_VALUE;
    	for(long i: ar) {
    		max = Math.max(max, i);
    	}
    	return max;
    }
    
    public static int upperBound(int[] array, int value) {
    	//return next higher element. If greater than all elements then returns array.length
    	//returns 0 if smaller than all elements
    	int low = 0;
    	int high = array.length;
    	while (low < high) {
    		final int mid = (low + high) / 2;
    		if (value >= array[mid]) {
    			low = mid + 1;
    		} else {
    			high = mid;
    		}
    	}
    	return low;
    }
    
    public static int lowerBound(int[] array, int value) {
    	//Returns first occurrence.
    	//Bigger than all elements then return array.length
    	//Not found, then next greater.s
    	int low = 0;
    	int high = array.length;
    	while (low < high) {
    		final int mid = (low + high) / 2;
			if (value <= array[mid]) {
			high = mid;
			} else {
				low = mid + 1;
			}
    	}
    	return low;
	}
    
    //Segment Tree
    static class SegNode {
    	//SegNode contains all query variables
    	long v;
    	SegNode() {
    		//Initialise using identity values
    		v = Integer.MIN_VALUE;
    	}
    	
    	SegNode(long v) {
    		this.v = v;
    	}
    	
    	public void merge(SegNode l, SegNode r) {
    		this.v = Math.max(l.v, r.v);
    	}
    }
    
    static class SegUpdate {
    	//It contains only the updates not the query variables.
    	long v; 
    	SegUpdate() {
    		//Initialise all segupdate variables here with identity values
    		// 0 for sum
    		//Integer.MAX_VALUE for min operations
    		// 1 for product, etc.
    		this.v = 0;
    	}
    	
    	SegUpdate(long v) {
    		this.v = v;
    	}
    	
    	//Combine current update with other update.
    	//Other update is newer than my present update
    	//In case of non-lazy propagation leave this blank
    	public void combine(SegUpdate other, int tl, int tr) {
    	}
    	
    	//Apply all updates so far in the query variables inside SegNode
    	//In case of non-lazy updates, consider x to be a leaf node.
    	public void apply(SegNode x, int tl, int tr) {
    		x.v = v;
    	}
    }
    
    static class SegTree {
    	int len;
    	SegNode[] t;
    	SegUpdate[] u;
    	boolean[] lazy;
    	
    	SegTree(int l){
    		len = l;
    		t = new SegNode[4 * len];
    		for(int i = 0; i < t.length; i++) t[i] = new SegNode();
    		u = new SegUpdate[4 * len];
    		for(int i = 0; i < u.length; i++) u[i] = new SegUpdate();    		
    		lazy = new boolean[4 * len];
    	}
    	
    	int descent(int x, int l) {
    		return descent(1, 0, len - 1, x, l);
    	}
    	
    	int descent(int v, int tl, int tr, int x, int l) {
    		pn(x+" "+l);
    		while(tl != l) {
    			pn(tl+" "+tr);
    			int tm = (tl + tr) >> 1;
    			if(l < tm) {
    				tr = tm - 1;
    				v = 2*v;
    			} else {
    				tl = tm;
    				v = 2*v + 1;
    			}
    		}
    		
    		if(t[v].v < x) {
    			return -1;
    		} 
    		
    		while(tl < tr) {
    			int tm = (tl + tr)/2;
    			if(t[2*v].v >= x) {
    				tr = tm;
    				v = 2*v;
    			} else {
    				tl = tm + 1;
    				v = 2*v + 1;
    			}
    		}
			return tl;
    	}
     
    	void pushdown(int v, int tl, int tr){
    		if(!lazy[v]) return;
    		int tm = (tl + tr) >> 1;
    		apply(v<<1, tl, tm, u[v]);
    		apply(v<<1|1, tm + 1, tr, u[v]);
    		u[v] = new SegUpdate();
    		lazy[v] = false;
    	}
     
    	void apply(int v, int tl, int tr, SegUpdate upd){
    		if(tl != tr){
    			lazy[v] = true;
    			u[v].combine(upd, tl, tr);
    		}
    		upd.apply(t[v], tl, tr);
    	}
    	
    	private void build(int[] arr, int v, int tl, int tr){
    		if(tl == tr){
    			t[v] = new SegNode(arr[tl]);
    			return;
    		}
    		int tm = (tl + tr) >> 1;
    		build(arr, v<<1, tl, tm);
    		build(arr, v<<1|1, tm + 1, tr);
    		t[v].merge(t[v<<1], t[v<<1|1]);
    	}
     
    	private SegNode query(int v, int tl, int tr, int l, int r){
    		if(l > tr || r < tl){
    			return new SegNode();
    		}
    		if(tl >= l && tr <= r){
    			return t[v];
    		}
    		pushdown(v, tl, tr);
    		int tm = (tl + tr) >> 1;
    		SegNode a = query(v<<1,tl,tm,l,r),b = query(v<<1|1,tm+1,tr,l,r);
    		SegNode ans = new SegNode();
    		ans.merge(a,b);
    		return ans;
    	}
     
    	// rupd = range update
    	private void rupd(int v, int tl, int tr, int l, int r, SegUpdate upd){
    		if(l > tr || r < tl){
    			return;
    		}
    		if(tl >= l && tr <= r){
    			apply(v,tl,tr,upd);
    			return;
    		}
    		pushdown(v,tl,tr);
    		int tm = (tl + tr) >> 1;
    		rupd(v<<1,tl,tm,l,r,upd);
    		rupd(v<<1|1,tm+1,tr,l,r,upd);
    		t[v].merge(t[v<<1], t[v<<1|1]);
    	}
     
    	void build(int[] arr){
    		build(arr, 1, 0, len - 1);
    	}
    	
    	void build(long[] arr){
    		build(arr, 1, 0, len - 1);
    	}
    	
    	private void build(long[] arr, int v, int tl, int tr){
    		if(tl == tr){
    			t[v] = new SegNode(arr[tl]);
    			return;
    		}
    		int tm = (tl + tr) >> 1;
    		build(arr, v<<1, tl, tm);
    		build(arr, v<<1|1, tm + 1, tr);
    		t[v].merge(t[v<<1], t[v<<1|1]);
    	}
    	
    	SegNode query(int l, int r){
    		return query(1,0,len-1,l,r);
    	}
    	
    	void rupd(int l, int r, SegUpdate upd){
    		rupd(1,0,len-1,l,r,upd);
    	}
    	
    	void debug() { 
    		System.out.println("------Debug-----");
    		for(int i = 0; i < 4 * len; i++) {
        		System.out.print(t[i].v+" ");
        	}
    		
    		for(int i = 0; i < 4 * len; i++) {
        		System.out.print(u[i].v+" ");
        	}
    		
        	System.out.println();
        	System.out.println(Arrays.toString(lazy));
        	System.out.println("-------------");
    	}
    }
   
    public static void pn(Object o) {
      System.out.println(o);
    }
    
    static class InputReader {
 
        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar;
        private int snumChars;
        private SpaceCharFilter filter;
 
        public InputReader(InputStream stream) {
            this.stream = stream;
        }
 
        public int snext() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }
 
        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
 
            int res = 0;
 
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
 
            return res * sgn;
        }
        
        public int ni() {
        	return nextInt();
        }
 
        public long nextLong() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
 
            long res = 0;
 
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
 
            return res * sgn;
        }
        
        public long nl() {
        	return nextLong();
        }
 
        public String readString() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }
 
        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }
 
        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }
}