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.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.*;

import static java.lang.Math.*;

public class Main {

    final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok = new StringTokenizer("");

    void init() throws FileNotFoundException {
        if (ONLINE_JUDGE) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        } else {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        }
    }

    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine());
        }
        return tok.nextToken();
    }

    int readInt() throws IOException {
        return Integer.parseInt(readString());
    }

    long readLong() throws IOException {
        return Long.parseLong(readString());
    }

    double readDouble() throws IOException {
        return Double.parseDouble(readString());
    }

    public static void main(String[] args) {
        new Main().run();
        // Sworn to fight and die
    }

    public static void mergeSort(int[] a) {
        mergeSort(a, 0, a.length - 1);
    }

    private static void mergeSort(int[] a, int levtIndex, int rightIndex) {
        final int MAGIC_VALUE = 50;
        if (levtIndex < rightIndex) {
            if (rightIndex - levtIndex <= MAGIC_VALUE) {
                insertionSort(a, levtIndex, rightIndex);
            } else {
                int middleIndex = (levtIndex + rightIndex) / 2;
                mergeSort(a, levtIndex, middleIndex);
                mergeSort(a, middleIndex + 1, rightIndex);
                merge(a, levtIndex, middleIndex, rightIndex);
            }
        }
    }

    private static void merge(int[] a, int levtIndex, int middleIndex,
                              int rightIndex) {
        int length1 = middleIndex - levtIndex + 1;
        int length2 = rightIndex - middleIndex;
        int[] levtArray = new int[length1];
        int[] rightArray = new int[length2];
        System.arraycopy(a, levtIndex, levtArray, 0, length1);
        System.arraycopy(a, middleIndex + 1, rightArray, 0, length2);
        for (int k = levtIndex, i = 0, j = 0; k <= rightIndex; k++) {
            if (i == length1) {
                a[k] = rightArray[j++];
            } else if (j == length2) {
                a[k] = levtArray[i++];
            } else {
                a[k] = levtArray[i] <= rightArray[j] ? levtArray[i++]
                        : rightArray[j++];
            }
        }
    }

    private static void insertionSort(int[] a, int levtIndex, int rightIndex) {
        for (int i = levtIndex + 1; i <= rightIndex; i++) {
            int current = a[i];
            int j = i - 1;
            while (j >= levtIndex && a[j] > current) {
                a[j + 1] = a[j];
                j--;
            }
            a[j + 1] = current;
        }
    }

    public void run() {
        try {
            long t1 = System.currentTimeMillis();
            init();
            solve();
            out.close();
            long t2 = System.currentTimeMillis();
            System.err.println("Time = " + (t2 - t1));
        } catch (Exception e) {
            e.printStackTrace(System.err);
            System.exit(-1);
        }
    }



    class LOL implements Comparable<LOL> {

        int x;
        int y;



        public LOL(int x, int y) {
            this.x = x;
            this.y = y;

        }

        @Override
        public int compareTo(LOL o) {

            return (x - o.x); // ---->
            //return o.x * o.y - x * y; // <----
        }

    }

    class LOL2 implements Comparable<LOL2> {

        int x;
        int y;
        int z;



        public LOL2(int x, int y, int z) {
            this.x = x;
            this.y = y;
            this.z = z;
        }

        @Override
        public int compareTo(LOL2 o) {

            return (z - o.z); // ---->
            //return o.x * o.y - x * y; // <----
        }

    }

    class test implements Comparable<test> {

        long x;
        long y;



        public test(long x, long y) {
            this.x = x;
            this.y = y;

        }

        @Override
        public int compareTo(test o) {
            //int compareResult = Long.compare(y, o.y); // ---->

            //if (compareResult != 0) {
            //    return -compareResult;
            //}

            int compareResult = Long.compare(x, o.x);

            if (compareResult != 0) {
                return compareResult;
            }

            return Long.compare(y, o.y);

            //return o.x * o.y - x * y; // <----
        }

    }

    class data {
        String name;
        String city;

        data(String name, String city) {
            this.city = city;
            this.name = name;
        }
    }

    class Point {
        double x;
        double y;


        Point(double x, double y) {
            this.x = x;
            this.y = y;

        }

        double distance(Point temp) {
            return Math.sqrt((x - temp.x) * (x - temp.x) + (y - temp.y) * (y - temp.y));
        }

        double sqrDist(Point temp) {
            return ((x - temp.x) * (x - temp.x) + (y - temp.y) * (y - temp.y));
        }

        Point rotate(double alpha) {
            return new Point(x * cos(alpha) - y * sin(alpha), x * sin(alpha) + y * cos(alpha));
        }

        void sum(Point o) {
            x += o.x;
            y += o.y;
        }

        void scalarProduct(int alpha) {
            x *= alpha;
            y *= alpha;
        }

    }

    class Line {
        double a;
        double b;
        double c;

        Line(Point A, Point B) {
            a = B.y - A.y;
            b = A.x - B.x;
            c = -A.x * a - A.y * b;
        }
        Line(double a, double b, double c) {
            this.a = a;
            this.b = b;
            this.c = c;
        }

      Point intersection(Line o) {
            double det = a * o.b - b * o.a;
            double det1 = -c * o.b + b * o.c;
            double det2 = -a * o.c + c * o.a;
            return new Point(det1 / det, det2 / det);
        }
    }

 /*   class Plane {
        double a;
        double b;
        double c;
        double d;

        Plane (Point fir, Point sec, Point thi) {
            double del1 = (sec.y - fir.y) * (thi.z - fir.z) - (thi.y - fir.y) * (sec.z - fir.z);
            double del2 = (thi.x - fir.x) * (sec.z - fir.z) - (thi.z - fir.z) * (sec.x - fir.x);
            double del3 = (thi.y - fir.y) * (sec.x - fir.x) - (thi.x - fir.x) * (sec.y - fir.y);
            a = del1;
            b = del2;
            c = del3;
            d = -fir.x * del1 - fir.y * del2 - fir.z * del3;
        }

        double distance(Point point) {
            return abs(a * point.x + b * point.y + c * point.z + d) / sqrt(a * a + b * b + c * c);
        }


    } */

    class record implements Comparable<record> {
        String city;
        Long score;

        public record(String name, Long score) {
            this.city = name;
            this.score = score;
        }

        @Override
        public int compareTo(record o) {
            if (o.city.equals(city)) {
                return 0;
            }

            if (score.equals(o.score)) {
                return 1;
            }

            if (score > o.score) {
                return 666;
            } else {
                return -666;
            }

            //return Long.compare(score, o.score);

        }

    }

    public long gcd(long a, long b) {
        if (a == 0 || b == 0) return max(a, b);

        if (a % b == 0)
            return b;
        else
            return gcd(b, a % b);
    }

    boolean prime(long n) {
        if (n == 1) return false;
        for (int i = 2; i <= sqrt(n); i++)
            if (n % i == 0)
                return false;
        return true;
    }

    public int sum(long n) {
        int s = 0;

        while (n > 0) {
            s += (n % 10);
            n /= 10;
        }

        return s;

    }

 /*   public void simulation(int k) {
        long ans = 0;
        int start = 1;
        for (int i = 0; i < k; i++) {
            start *= 10;
        }
        for (int i = start/10; i < start; i++) {
            int locAns = 0;
            for (int j = start/10; j < start; j++) {
                if  (sum(i + j) == sum(i) + sum(j) ) {
                    ans += 1;
                    locAns += 1;
                } else {
                    //.println(i + "!!!" + j);
                }
            }
            //out.println(i + " " + locAns);
        }
        out.println(ans);
    }*/


    int n;

    ArrayList<Integer> primes;
    boolean[] isPrime;

    public void getPrimes (int n) {
        isPrime[0] = false;
        isPrime[1] = false;
        for (int i = 2; i <= n; i++) {
            if (isPrime[i]) {
                primes.add(i);
                if (1l * i * i <= n) {
                    for (int j = i * i; j <= n; j += i) {
                        isPrime[j] = false;
                    }
                }
            }
        }
    }




    public long binPowMod(long a, long b, long mod) {
        if (b == 0) {
            return 1 % mod;
        }

        if (b % 2 != 0) {
            return ((a % mod) * (binPowMod(a, b - 1, mod) % mod)) % mod;
        } else {
            long temp = binPowMod(a, b / 2, mod) % mod;
            long ans = (temp * temp) % mod;
            return ans;

        }
    }


    int type[];
    boolean vis[];

    HashMap<Integer, HashSet<Integer>> g;

    int componentNum[];

  /*  void dfs(int u, int numOfComponent) {
        vis[u] = true;
        componentNum[u] = numOfComponent;

        for (Integer v: g.get(u)) {
            if (!vis[v]) {
                dfs(v, numOfComponent);
            }
        }
    } */

    int p[];

    int find(int x) {
        if (x == p[x]) {
            return x;
        }

        return p[x] = find(p[x]);
    }

    boolean merge(int x, int y) {
        x = find(x);
        y = find(y);
        if (p[x] == p[y]) {
            return false;
        }
        p[y] = x;
        return true;
    }

    class Trajectory {
        double x0;
        double y0;
        double vx;
        double vy;


        Trajectory(double vx, double vy, double x0, double y0) {
            this.vx = vx;
            this.vy = vy;

            this.x0 = x0;
            this.y0 = y0;
        }

        double y (double x) {
            return y0 + (x - x0) * (vy / vx) - 5 * (x - x0) * (x - x0) / (vx * vx);
        }

        double der(double x) {
            return (vy / vx) - 10 * (x - x0) / (vx * vx);
        }


    }


    public void solve() throws IOException {

        int n = readInt();
        int k = readInt();

        char[][] maze = new char[4][n + 1];

        maze[1][0] = 'X';
        maze[2][0] = 'X';

        for (int i = 0; i < n + 1; i++) {
            maze[0][i] = 'X';
            maze[3][i] = 'X';
        }

        String temp1 = readString();
        String temp2 = readString();

        for (int i = 1; i <= n; i++) {
            maze[1][i] = temp1.charAt(i - 1);
            maze[2][i] = temp2.charAt(i - 1);
        }

        int[][] dist = new int[4][n + 1];
        int[][] time = new int[4][n + 1];
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < n + 1; j++) {
                dist[i][j] = Integer.MAX_VALUE;
            }
        }

        dist[1][1] = 0;

        ArrayDeque<Integer> xValue = new ArrayDeque<Integer>();
        ArrayDeque<Integer> yValue = new ArrayDeque<Integer>();

        xValue.add(1);
        yValue.add(1);
        int t = 1;
        while (!xValue.isEmpty()) {

            int currX = xValue.poll();
            int currY = yValue.poll();

            if (currY + 1 > n || currY + k > n) {
                out.print("YES");
                return;
            }

            if ((dist[currX][currY + 1] > dist[currX][currY] + 1) && maze[currX][currY + 1] == '-') {
                dist[currX][currY + 1] = dist[currX][currY] + 1;
                xValue.add(currX);
                yValue.add(currY + 1);
                time[currX][currY + 1] = time[currX][currY] + 1;
            }

            if ((dist[currX][currY - 1] > dist[currX][currY] + 1) && maze[currX][currY - 1] == '-' && currY - 1 > time[currX][currY] + 1) {

                dist[currX][currY - 1] = dist[currX][currY] + 1;
                xValue.add(currX);
                yValue.add(currY - 1);
                time[currX][currY - 1] = time[currX][currY] + 1;
            }

            if ((dist[3 - currX][currY + k] > dist[currX][currY] + 1) && maze[3 - currX][currY + k] == '-') {
                dist[3 - currX][currY + k] = dist[currX][currY] + 1;
                xValue.add(3 - currX);
                yValue.add(currY + k);
                time[3 - currX][currY + k] = time[currX][currY] + 1;
            }



        }

        out.print("NO");


    }



}